View Full Version : Setting rotation keyframes for X, Y Z angles

06 June 2008, 06:56 PM
I'm writing a script that will rotate any given object at any given keyframe. For reasons I won't get into, I specifically have to set these rotations using addNewKey (), not the rotation () function, so I'm working directly with the controller and have some questions. I also have to stick with the default Euler_XYZ controller, so I can't change that or add a new one.

Can anyone try to give me a basic overview of Euler XYZ vs. quaternions, and how to solve the usual problems with rotation (rotating past 180 degrees, gimbal lock, etc.)?

Basically, here's what I think I know so far:

1) An object is created with a Euler_XYZ controller by default to handle its rotation/orientation.

2) I read somewhere that despite this, working with the root controller means working with quaternions-- how can this be? Isn't there a separate quaternion controller?

3) In either case, what kind of problems will I have trying to simply write to the x_rotation/y_rotation/z_rotation controllers directly? I've been doing this by writing new values to them, or adding new angles to the existing values to rotate the object, and it seems to work, although I do have issues rotationg past 180 degrees.

Also, where exactly does gimbal lock come into play?

Basically what I want to be able to rotate an object using the Euler_XYZ controller by any angle on any of its axes (including multiple axes at once) on a given keyframe. Can someone at least point me in the direction of how to do this the right way, so everything is stable and predictable? I'd also like to learn what's really going on under the hood here.


CGTalk Moderation
06 June 2008, 06:56 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.