Rotation and what the hell...
by Kevin Mitchell · in Torque 3D Professional · 03/14/2013 (9:59 pm) · 5 replies
I'm not a 3d math genius, this i know. But I've just been studying the rotation and what certain angles give me in the rotation rollout in the editor.
I believe that the X Y Z in the field seems to be related to the Pitch, Roll, and Heading.
The Angle being the 4th field. But why does the angle invert after 240 degrees? Is this some special number? A limitation? I can't figure it out. Is it because of radians?
I believe that the X Y Z in the field seems to be related to the Pitch, Roll, and Heading.
The Angle being the 4th field. But why does the angle invert after 240 degrees? Is this some special number? A limitation? I can't figure it out. Is it because of radians?
About the author
Riding Solo since 2005. Current Project: Fated World 2005-Present RPG Engine Tool Kit - Now available.
#2
03/15/2013 (5:58 am)
I just read up on gimble lock and I can see where that would come in. I really think i need a 3d math book but I have no clue what a good one would be. I believe this would currently be my biggest limitation in the goals that I am trying to achieve for my release and I do not want to release something that someone can look at and go. Hmm you did this the hardest way possible...
#3
If the rotation you are looking at has four values then that is an angled axis. The first three values define a vector, and the fourth value is a rotation about that vector. And when using an angled axis on its own, the angle is in degrees (in TorqueScript)
If you ever run across a TransformF (a position and a rotation), unfortunately its angled axis component uses radians for the angle.
An angled axis itself shouldn't experience gimbal lock as you're just rotating about some vector 0-360 degrees. But if you do use Euler angles (three values to define a rotation as pitch, roll, and yaw) then you will come across gimbal lock with certain ranges.
- Dave
03/15/2013 (11:26 am)
@Kevin:If the rotation you are looking at has four values then that is an angled axis. The first three values define a vector, and the fourth value is a rotation about that vector. And when using an angled axis on its own, the angle is in degrees (in TorqueScript)
If you ever run across a TransformF (a position and a rotation), unfortunately its angled axis component uses radians for the angle.
An angled axis itself shouldn't experience gimbal lock as you're just rotating about some vector 0-360 degrees. But if you do use Euler angles (three values to define a rotation as pitch, roll, and yaw) then you will come across gimbal lock with certain ranges.
- Dave
#4
03/19/2013 (10:02 am)
thanks dav, i guess what im using to calculate rotations wont hit a gimble lock. Sometimes it just hard to know which way is forward for a given items sometimes. Probably something else i have to look up.
#5
Now which value inverts after a value of 240? The fourth value? It might be interesting to spreadsheet this to see "why". The X,Y,and Z component should not matter and should be relative magnitude, unless something is happening in the normalization of the values. Does it normalize them on you? Normalize = values scaled to 1.0 or less.
03/19/2013 (12:37 pm)
Yeah, there are a few ways to represent the rotation in 3D space of an object. I think that exposed to the editor is Axis Angles, but there are other 4 value representations like quaternions. As far as I know those are NOT exposed to the editor for any object. A good thing because those are hard to visualize. Now which value inverts after a value of 240? The fourth value? It might be interesting to spreadsheet this to see "why". The X,Y,and Z component should not matter and should be relative magnitude, unless something is happening in the normalization of the values. Does it normalize them on you? Normalize = values scaled to 1.0 or less.
Associate Ron Kapaun
3tdstudios.com
Just guessing here, but my answer would be radians. To be more accurate, Gimbal lock, or the lack of being able to handle the state. I have run into this issue with a number of rotation solutions in a variety of 3D apps, including 3D MAX and Blender. Most developers think of a rotation as 360 degrees, they don't always consider 360 degrees +.
Just a thought. Not a solution. (I am by no means an expert.)
Ron