RotateEntity

Blitz3D Forums/Blitz3D Beginners Area/RotateEntity

Faldo(Posted 2004) [#1]
Hello,

I don't understand the result of RotateEntity Object, x, y, z.

What is the order of rotations ? Is every rotation done on absolute axis or rotated axis ?

When I only use X rotation, no problem. X and Y rotations, no problem too. But when I use X, Y and Z rotations, it's very hard to understand the way the rotation is done.

My problem is I want to represent a vehicle running on non plane path and I have to use the RotateEntity to orient my vehicle on a realistic way.

Can someone help me ?


Ross C(Posted 2004) [#2]
Z is done first, then X then Y. I belive that's the rotation order. If you trying to align something to something else, you should have a look at the align to vector command. Using the normals of the collision between the two, and plug the NX,NY and NZ into the Aligntovector command :o)


Ross C(Posted 2004) [#3]
Something like:

AlignToVector vehicle, CollisionNX(), CollisionNY(), CollisionNZ(), 3, 1


Read up on the aligntovector command and the collision normals :o)


Faldo(Posted 2004) [#4]
Thanks :)


wizzlefish(Posted 2004) [#5]
Ross C - I've noted that you've put ":o)" after almost all of your recent posts.


Ross C(Posted 2004) [#6]
Cause i'm a nice person and like to smile :o)


Floyd(Posted 2004) [#7]
The order is Y,X,Z and subsequent turns are about the newly rotated axes.
Graphics3D 400, 300, 0, 2

e=CreatePivot()

TurnEntity   e, 0, 20, 0
TurnEntity   e, 10, 0, 0
TurnEntity   e, 0,  0, 30

Print " Angles are  "+EntityPitch(e)+" "+EntityYaw(e)+" "+EntityRoll(e)

RotateEntity e, 10, 20, 30

Print " Angles are  "+EntityPitch(e)+" "+EntityYaw(e)+" "+EntityRoll(e)

WaitKey()  :  End



Ross C(Posted 2004) [#8]
Ah, sorry for the bum info. That's the order i rotated my quads in my particle system ^_^