[ODE] Getting front vector from rotation matrix

Tom De Muer tom.demuer at skynet.be
Mon Feb 9 15:59:37 MST 2004


> Hi,
>
> I'm having a math problem with ODE that I would like to ask for your help.
>
> I am making a simple car game with ODE under OpenGL, and I am tryng to
make
> the camera to follow my car. The problem is, that I need the front vector
of
> the car to know where to put the camera, and ODE only gives the rotation
> matrix.
>
> Is there anyway to find the car front vector from the rotation matrix?
>

Use  dBodyGetRelPointPos( carBodyId, ... ) to determine the real-world
position of the driver (or camera), say  driverView.  Then again with
dBodyGetRelPointPos determine real-world position of a point in front of
your camera.  Then with gluLookAt it should be easy to have a camera
following your car-body.

> Thanks in advance,
> João Rangel
>

Cheers,
Tom
>



More information about the ODE mailing list