Jump to content
Sign in to follow this  
-=Firewall=-

Rotating an object around all axes

Recommended Posts

Good evening,

well it's easy to rotate the direction of an object from north to south along the Z axis. But I would like to know if theres a way to rotate an object around the other axes? For example: rotating a sandbagwall so that its right side is facing up and the left side is facing down to the ground or something like a diagonal direction.

Share this post


Link to post
Share on other sites
Do you mean setVectorUp command?

Thank you for your help.

This command changes the up-vector only by 90 degrees. I need a command to tilt an object by a variable amount. e.g. to tilt the nose of an object 20 degrees down. ;)

Share this post


Link to post
Share on other sites

I tried it already, but it doesn't work!?? If a value is bigger than 0 it turns the object around by 90 degrees :confused:

Share this post


Link to post
Share on other sites

Might help and might sound stupid, but we'll make an example in order that you catch it easily :-)

First, vectorUp and vectorDir commands info in BIS command index is a little bit confusing with banking and tilting so look closely to this.

In order to do ANYTHING POSSIBLE with vector positioning, you need to work with setVectorDir and setVectorUp commands.

1) Arma 2 axes system: x is east-west (east being positive), y is north-south (north being positive), z is height (up being positive).

2) Let's open your editor and place an empty object of your choice, let's say a humvee named car and facing north (0 degrees). In BIS position coordinates, this corresponds to an initial direction vector of...[0,1,0] in a [x,y,z] you agree?

P.S. Whatever they say, use [x,y,z] in this demo to understand not [x,z,y]. or else...

3) You can even try to set the direction yourself without looking at the little easy user compass in the object properties. Let's say we want the vehicle facing 45 degrees, then we need...setVectorDir [1,1,0].

4) Ok with the humvee back at 0 degress, add another object, a fuel can and attach it to the humvee. You have to write this in the fuel can init: this attachTo [car,[0,0,0]]; The can will be attached over the vehicle but stable like flying in the air. We're doing this just to stabilize the fuel can in this example, if not, tilting the can will result in it droping due to gravity. But we want to see something fixed right?

5) If you kept everything facing north, it must be [0,1,0] again. Now let's say we want to tilt the fuel can back by 45 degrees. Remember that the vectorDir is [0,1,0] and note that the vectorUp is a vector starting at the center of the fuel can pointing to the sky. By default then, vectorUp is [0,0,1]. For tilting back 45 degrees, we need...this setVectorUp [0,-1,1] which will result in a vector tilted backward at a 45 degrees angle from the z axis right? ...Look at the result in the editor.

Cheers

Edited by Wingsbaron

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×