[ODE] help with camera...

Pablo Barbáchano pablobarbachano at yahoo.es
Tue Jan 28 13:38:01 2003


Hi, my problem is a bit off-topic, but I need to put a
camera in the same position and orientation that one
of my bodies (to drive from inside, hehe)

my camera code is similar to this (note that y is up
and x is pointing to the front):

{
dVector3 n_pos, n_up, n_view;
dBodyGetRelPointPos (body, 0,0,0, n_pos);
dBodyVectorToWorld (body, 0,1,0, n_up);
dBodyVectorToWorld (body, 1,0,0, n_view);
gluLookAt(n_pos [0], n_pos [1], n_pos [2],
          n_view[0], n_view[1], n_view[2],
          n_up  [0], n_up  [1], n_up  [2]);
}

It should work but gives me strange results... maybe
is something with gluLookAt??
There is a manual way to do this instead of
gluLookAt()?

I've tried to extract the info from the quaternions,
but doesn't work good either... (= I don't know how to
do it), and I would prefer to have the vectors.

Thanks a lot. Pablo

PS: if you want to look at the game:
brokenwing.sf.net,
but don't expect to see much... I'm just starting.

___________________________________________________
Yahoo! Móviles
Personaliza tu móvil con tu logo y melodía favorito 
en http://moviles.yahoo.es