Matrix Multiplication

hi, just wanna ask this. We all know that using gluperspective or glulookat generates matrices. These matrices are used to transform the points. Does anyone know when the multiplication is done? I mean the exact point.

the modelview matrix is multiplied as soon as you do the gluperspective or glulookat.

{
glLoadIdentity();
// modelview is identity

gluLookAt(…);
// modelview is the camera matrix

glTranslate(…);
// model view is camera matrix * translate matrix

glBegin(GL_POINTS);
glVertex3f(0,0,0);
}

the resulting point will be :

P = cam_matrix * translate * point_coordinates

you should read this paper : http://www.opengl.org/developers/code/mjktips/TimHall_Reflections.txt

at the beginning it explains all this very well, even if after it goes on explaining reflections.
good luck
cb

gluPerspective and gluLookAt don’t just generate a matrix, they multiply that matrix with the current matrix. The multiplication is immediate, but it is a little more complicated than that.

There are two matrices – model-view and projection. Generally, you use gluPerspective with the projection matrix and gluLookAt with the model-view matrix.

When you call glVertex, the position is multiplied by both matrices to get the location on the screen.

U guys are superb. Thx a million. appreciate it.