Author Topic: Object 3d Rotation  (Read 3460 times)

Offline bigfishcatcher

  • byte
  • *
  • Posts: 17
    • View Profile
Object 3d Rotation
« on: April 07, 2008, 05:27:18 pm »
I am working on a network racing game where the track goes up and down as well
as left and right.

I am also trying to do my own work on how to rotate the car.

The problem is when the car starts down a hill the Z axis is changed to make the car look like it
is going downhill (works fine)

but after you turn a curve the car starts rolling in what should be the X axis not the Z axis

Any ideas??

Thanks
Gary

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Object 3d Rotation
« Reply #1 on: April 07, 2008, 05:30:32 pm »
You can try to rotate it around the axes in its own coordinate system, i.e. instead of doing a rotateZ() do a rotateAxis(car.getZAxis()). That might help with this particular problem.

Offline bigfishcatcher

  • byte
  • *
  • Posts: 17
    • View Profile
Re: Object 3d Rotation
« Reply #2 on: April 08, 2008, 01:54:34 pm »
Thanks that does Great!