PDA

View Full Version : gluLookAt and the modelview matrix.



glguru
02-22-2000, 05:01 PM
Hi,
I am struggling with gluLookAt(...). Could someone please give me an indepth explanation of it? For example, say I am given the
eye point, the at point and the up direction,
how do I formulate the modelview matrix?

Thanks for your time.

j0rt3g4
04-01-2009, 03:23 PM
Well gluLookAt( POSITION, DIRECTION WHERE YOU LOOK, UP VECTOR)

the POSITION is a vector of 3 components and here is where you say where the camera is.
The next parameter is where you say... where to look at.

And the last one is the up vector... Is where you choose where is UP in the scene...

dletozeun
04-01-2009, 03:43 PM
how do I formulate the modelview matrix?


You don't formulate the modelview matrix with gluLookAt, it does it for you!
And if you want to re-write the gluLookAt function for your own purpose, look at the gluLookAt man page (http://www.opengl.org/sdk/docs/man/xhtml/gluLookAt.xml) and if it is not enough you can glance at the mesa opengl implementation source code.