On Mon, 26 May 2008 06:38:39 -0700 (PDT), Shafran wrote:
> Hello
>
> I am trying to move my gluLookAt to an object position (the object's
> origin) but I can't do it.
> i tried while creating the object to save its matrix:
> glGetFloatv(GL_MODELVIEW_MATRIX,mat); and somewhere else in the code
> to glMultMatrix(mat), but it seems wrong...
>
> maybe I misunderstand it all?
>
> can someone help?
>
> thanks!
If your object is at coordinates a, b, c, and you wish to face towards d,
e, f in the global coordinate system, then call
glLoadIdentity();
gluLookAt(a, b, c, d, e, f, 0, 1, 0);
The last three parameters define the vector that will be pointing up
(towards the top of your screen) when the resulting image is drawn.
--
"Let's see what's out there. Engage."
Jean Luc Picard, Star Trek: TNG, Encounter at Farpoint
http://pinpoint.wordpress.com/


|