www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: bigfishcatcher on April 07, 2008, 05:27:18 pm

Title: Object 3d Rotation
Post by: bigfishcatcher 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
Title: Re: Object 3d Rotation
Post by: EgonOlsen 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.
Title: Re: Object 3d Rotation
Post by: bigfishcatcher on April 08, 2008, 01:54:34 pm
Thanks that does Great!