Rotation Problem
by Bauer Ren · in Torque Game Engine · 05/25/2006 (8:14 am) · 3 replies
How the object-rotation in torque works?
what i found out:
0 0 1 50 // rotates the shape around the x coord
the same thing
0 1 0 50 // etc
1 0 0 50
but now my question:
if i want to rotate for example an object
50 10 100
how to i transform this to this rotation format. is there a tutorial for this?
thanks for any hint and reply
rene
what i found out:
0 0 1 50 // rotates the shape around the x coord
the same thing
0 1 0 50 // etc
1 0 0 50
but now my question:
if i want to rotate for example an object
50 10 100
how to i transform this to this rotation format. is there a tutorial for this?
thanks for any hint and reply
rene
About the author
Recent Threads
#2
The first 3 of the 4 digits is your rotation. pretty strait forward.
the last digit is basicaly the direction to spin. it's usually 1,0,-1.
it's not just as simple as setting your X Y Z rotations. there's actually some math involved in the process.
Perhaps you can do a search on converting to axis angles to quanternions on google
05/25/2006 (2:46 pm)
Torque uses Quanternion type for rotation, which is a bit different from standar rotations.The first 3 of the 4 digits is your rotation. pretty strait forward.
the last digit is basicaly the direction to spin. it's usually 1,0,-1.
it's not just as simple as setting your X Y Z rotations. there's actually some math involved in the process.
Perhaps you can do a search on converting to axis angles to quanternions on google
#3
05/25/2006 (2:56 pm)
Ramen is correct. (this is what I get for posting from work, doh!) Setting the exact desired rotation should be fine but rotating based on the current rotation requires a bit more thought.
Torque 3D Owner Matt Kronyak
RealmSource LLC
You can use getTransform to get the current transformation value, and to parse out individual position or rotation values use the getWord function.
So, for example:
If you wanted to set the rotation to exactly 50 10 100 0 you could simply do: