slorac
11-29-2000, 09:54 AM
I am trying to learn how to do shadows in opengl and having been looking at scube.c found at http://www.sgi/com/software/opengl/glut/examples. In the code to produce the shadow are the lines...
myShadowMatrix(groundPlane, lightPos);
glTranslatef(0.0, 0.0, 2.0);
glMultMatrixf((const GLfloat *) cubeXform);
My question is "Why is
glTranslatef(0.0, 0.0, 2.0);
called?"
I know that it isn't called then the shadow does not appear in the correct place. But it seems like to magic to me. I understand what myShadowmatrix does and what the glMultMatrix call does but the translation escapes me entirely. Please help!
myShadowMatrix(groundPlane, lightPos);
glTranslatef(0.0, 0.0, 2.0);
glMultMatrixf((const GLfloat *) cubeXform);
My question is "Why is
glTranslatef(0.0, 0.0, 2.0);
called?"
I know that it isn't called then the shadow does not appear in the correct place. But it seems like to magic to me. I understand what myShadowmatrix does and what the glMultMatrix call does but the translation escapes me entirely. Please help!