Rotation Hierarchy in TG2?

Started by PabloMack, December 30, 2011, 01:04:38 PM

Previous topic - Next topic

PabloMack

I can see impirically that the TG2 user interfaces presents rotation in the order Pitch,Heading,Bank. This is unlike LW that presents them in the order Heading,Pitch,Bank. I presume that these rotations are implemented in a hiearchy in the order they are presented. For instance, a change of Heading by 90° followed by a change in Pitch by 90° does not result in the same orientation as a change in Pitch by 90° followed by a change in Heading by 90°. So I am asking whether any one knows for sure that rotation is applied in order as presented in the TG2 User Interface. If so then moving camera orientation between TG2 and LW is not trivial.

After playing with it some more is appears that the rotation hierarchy in TG2 is the same as it is in LW even though they are presented in the UI is in a different order. If the rotations were done in order as presented in the TG2 UI then a Pitch of 10° would translate into a Bank of -10° after a change of heading by 90°. That is good news that it doesn't do this. Looks like moving rotation between the two programs is trivial after all. You just have to keep in mind that the order of the first two have to be swapped.

Matt

Lightwave's default rotation order always used to be Bank, Pitch, Heading, and I suppose it probably still is. That's the order that the rotations are applied mathematically, but not necessarily how they are ordered in the user interface. Terragen uses the same rotation order internally: Bank, Pitch, Heading. However, the user interfaces of the two programs list the values in different orders. Terragen's user interface shows X, Y, Z from left to right, according to the axes of rotation. X = Pitch, Y = Heading, Z = Bank. So Terragen shows you Pitch, Heading, Bank. If Lightwave shows you Heading, Pitch, Bank then you can convert between Terragen and Lightwave rotations by swapping the first and second values.
Just because milk is white doesn't mean that clouds are made of milk.

PabloMack

Quote from: Matt on January 03, 2012, 06:01:54 PM
Lightwave's default rotation order always used to be Bank, Pitch, Heading, and I suppose it probably still is. That's the order that the rotations are applied mathematically, but not necessarily how they are ordered in the user interface. Terragen uses the same rotation order internally: Bank, Pitch, Heading. However, the user interfaces of the two programs list the values in different orders. Terragen's user interface shows X, Y, Z from left to right, according to the axes of rotation. X = Pitch, Y = Heading, Z = Bank. So Terragen shows you Pitch, Heading, Bank. If Lightwave shows you Heading, Pitch, Bank then you can convert between Terragen and Lightwave rotations by swapping the first and second values.

This makes sense. Since Bank is done first it is affected by both Pitch and Heading. Pitch is done next and it is affected by Heading but not Bank. Since Heading is done last, it is not affected by either Pitch nor Bank. It is good to get this straight in my mind. Thank you for the insight.

Hetzen

Actually, rotation order does make a big difference. You can't just swap the order of values from one app to another. Both apps need to have the same rotation order to transfer camera information correctly.

To demonstrate. Use your finger pointing forward, then rotate your hand 45 positive degrees in X,Y,Z, then do the same but in Z,X,Y. Your hand will end in a different position.

Terragen's default rotation order is ZXY, so you'll need to make a ZXY camera in Lightwave (I don't know the program to help).

Here's a great video to explain the problem...

http://vimeo.com/2649637

Tangled-Universe

From time to time I'm really baffled by the lack of standardization in the CG industry, as if everybody is just doing things the way he likes to do, without considering compatibility. See the need for FBX and Alembic now (both which still don't have a solid base in the industry, or am I wrong here?)

Hetzen

There's good reason to be able to change the rotation order of the camera. In two words, Gimble Lock. See the video above. This is where two axis align and there is a wobble in the movement when rotating out.

Most software uses ZXY as it's default, as this is how a camera on a tripod rotates. But if you want to look down on an object, you would choose a different rotation order to avoid any gimble lock.

Matt

#6
Quote from: Hetzen on January 04, 2012, 06:16:51 AM
Actually, rotation order does make a big difference. You can't just swap the order of values from one app to another. Both apps need to have the same rotation order to transfer camera information correctly.

Absolutely true. Luckily Terragen and Lightwave (default) have the same rotation order: Bank, Pitch, Head. But it can be a problem when importing camera data that originated with a different rotation order.
Just because milk is white doesn't mean that clouds are made of milk.

Matt

It gets even more tricky to keep track of the differences when different programs have a different XYZ system. For example, if the Y axis in one program is equivalent to the Z axis in another, then to match a rotation order of 'ZXY' in the first program you'd need to use a rotation order of 'YXZ' in the second, because Y is really Z.
Just because milk is white doesn't mean that clouds are made of milk.