Author Topic: Object3D.rotate[X,Y,Z] confuse me.  (Read 1580 times)

Offline wylng

  • byte
  • *
  • Posts: 5
    • View Profile
Object3D.rotate[X,Y,Z] confuse me.
« 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Object3D.rotate[X,Y,Z] confuse me.
« Reply #1 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(), ...);