Object3D.rotate[X,Y,Z] confuse me.

Started by wylng, October 25, 2013, 01:30:58 PM

Previous topic - Next topic

wylng

I want to rotate my air plane when it's turning, so I call Object3D.rotateZ for help, it works alright.
but, when my plane climbing up, I call rotateX first, then call RotateZ, it does not work the way I want it to, RotateZ seems to rotate the plane around it's old Z axis (before rotateX was call), and I want to rotate the plane around it's new Z axis. (the plane Z asix changes after I call rotateX)
thanks

EgonOlsen

Yes, that's the defined behaviour for that kind of rotations. What you have to do instead is something like


obj.rotateAxis(obj.getZAxis(), ...);