Rotate relative to fixed axis?

Started by stonef, May 05, 2011, 03:29:59 AM

Previous topic - Next topic

stonef

How do i rotate a Object3D relative to it's originally fixed axis? Like for example if i want to rotate without jPCT i call
gl.glRotatef(xangle, 1, 0, 0) //rotate X axis
gl.glRotatef(yangle, 0, 1, 0) //rotate Y axis

Meaning i will always let Z be unchanged.

If i use myObj.rotateX / myObj.rotateY i will end up with Z axis changed as well.

Kaiidyn

Not sure this is what you are looking for, but try calling myObj.clearRotation() before calling the actual rotation.
Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer's intent but rather is full of crisp abstractions and straightforward lines of control. - Grady Booch

EgonOlsen

You can rotate any axis using the rotateAxis-method.