Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

After Effects

Sign in to follow this  


Today I spent some time trying to convert some 3D animation information I had laying around into a form that Adobe After Effects would take. Adobe After Effects stores two sets of rotation information for 3D layers: one called Orientation, and then X Rotation, Y Rotation and Z Rotation. Orientation is actually represented internally as a quaternion; however, it's expressed to the end user as a series of rotations, X, Y and Z. This is annoying, but something that you can live with. Or at least, since I'm a programmer I can live with it since I can automate the task of converting quaternions to the Euler angles.

The part that boggles my mind is that the rotations are X degrees counter clockwise around the X-axis, then Y degress clockwise about the Y-axis, and then Z degrees clockwise about the Z-axis. When I first saw that I said, huh, must be a left handed system, not a right handed system. Then I looked at the layer information, and there in the comp window are the three axes of rotation, and yup, it's CCW about the X, CW about the Y and CW about Z.

So after spending about an hour screwing up the derivation of the quaternion conversion to the After Effects Orientation format on paper, I finally sat down with IDLE and brute forced a derivation. That is taking each component of the rotation matrix that represents a given quaternion and applying arc sines, arc cosines and arc tangents to various combinations of the matrix elements until I got the orientation back that I used to generate the quaternion.

It's a hack, but it works. At least out to the square root of epsilon of a double for all the inputs I've tried so far, which is good enough for me.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!