www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: stonef on May 05, 2011, 03:29:59 am

Title: Rotate relative to fixed axis?
Post by: stonef on May 05, 2011, 03:29:59 am
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.
Title: Re: Rotate relative to fixed axis?
Post by: Kaiidyn on May 05, 2011, 10:05:30 am
Not sure this is what you are looking for, but try calling myObj.clearRotation() before calling the actual rotation.
Title: Re: Rotate relative to fixed axis?
Post by: EgonOlsen on May 05, 2011, 05:15:39 pm
You can rotate any axis using the rotateAxis-method.