Game Development Community

Rotation Interpolation

by Gustavo Boni · in Torque Game Engine · 02/14/2008 (8:47 am) · 1 replies

Hi everyone,

I need to rotate an object on X axis, but i need a smooth rotation. Does anyone know how to do that?

Thanks

#1
02/14/2008 (11:28 am)
What kind of object?
In script or code?

Rotations done by script are performed using the setTransform (if allowed by the object type) and use the axis-angle attitude representation of the transform fields 3..6.

Rotating an angle theta about the X axis would be: 1 0 0 theta
You could just interpolate the correct angle per the time elapsed and set the transform.
I believe theta would be in radians for rotations done in script during run time, and degrees for initial values in the mission file. You might have to change the sign of the theta angle or use -1 0 0 theta to get it to rotate the correct direction.

If your object is not aligned to the world axes, it could also get more messy.