Rotation in Cinematics

I use the following code to rotate in cinematics:


// create an animation event

AnimationFactory factory = new AnimationFactory(animationDuration,


factory.addTimeTranslation(0, new Vector3f(oldX, oldY, oldZ));

factory.addTimeRotationAngles(0, 0, 0, rotRad);

factory.addTimeRotationAngles(animationDuration, 0, 0,

(float) Conversions.degreesToRad(newAngle));

// attach anim to this spatial

AnimControl control = spatial.getControl(AnimControl.class);

if (control == null) {

control = new AnimControl();





it works fine except that to rotate from -90 degrees to 180 degrees it does the whole turn positively rather than a short rotation negatively. In other words it does not treat 180 and -180 degrees the same way. Any work around that ? or I should treat them differently?

You are running into the usual problems with rotations and euler angles, just use direction vectors and lookAt.