www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: wylng on October 25, 2013, 01:30:58 pm

Title: Object3D.rotate[X,Y,Z] confuse me.
Post by: wylng on October 25, 2013, 01:30:58 pm
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
Title: Re: Object3D.rotate[X,Y,Z] confuse me.
Post by: EgonOlsen on October 25, 2013, 08:32:47 pm
Yes, that's the defined behaviour for that kind of rotations. What you have to do instead is something like

Code: [Select]
obj.rotateAxis(obj.getZAxis(), ...);