PDA

View Full Version : I don't like glRotate and glTranslate hehehe :)



Evil-Dog
08-16-2001, 10:07 AM
Hi. I'm trying to figure out how to move around my 3d world and also place my object and move them independently of the camera...and also without using gluLookAt
Can anyone help ?

Evil-Dog
08-16-2001, 10:13 AM
Precision : If you could enlighten me with how to use glPushMatrix and glPopMatrix and also what is the proper order to draw and transfom( rotate and translate ) object in the 3d world I would be pleased !
I need the logic of the camera and the object.
Thanks alot

Michael Steinberg
08-16-2001, 03:13 PM
Move the objects around with the ModelView matrix. glRotate, glTranslate and glScale.
Now your object are placed in the world-coordinate system.

Then put together a matrix that would represent the camera-object (ie. position of the camera negatively). Matrix 1 is the result.
Then get the rotation matrix of the camera. Transpose this matrix (orthogonal transpose = inverse) and the resulting one is Matrix 2.
Take Matrix2 * Matrix1 = Matrix 3.
Multiply Matrix 3 on the objects modelview matrix. There you go.

zed
08-16-2001, 10:59 PM
if u understand gluLookAt(..) then use it, youll pick up linear algebra with time.
btw carmack used a function called myGluLookAt(..) in quake1 http://www.opengl.org/discussion_boards/ubb/smile.gif