I am using GLUT, though I don’t think it matters much. I have a preloaded series of coordinates, and I want to get an object (in this case, a bird) to simply move to each coordinate in time. Here’s the pseudocode for my display function:
void gDisplay(void){
…
glLoadIdentity();
adjust camera using glLookAt();
glPushMatrix();
update values of birdX, birdY, birdZ;
glLoadIdentity();
glTranslatef(birdX, birdY, birdZ);
drawBird();
glPopMatrix();
draw static objects;
glutSwapBuffers();
}
I had thought that using the second glLoadIdentity would enable me to do this, since birdX, birdY, and birdZ are absolute coordinates. (relative not to the previous values of birdX,Y,Z but to the original values of birdX,Y,Z @ (0,0,0).) However, the bird does not draw at all when I do this! I clearly do not understand the full ramifications of calling glLoadIndentity().
If I omit glLoadIndentity, the bird translates by birdX,Y,Z from its previous location, right? I clearly do not want this.
P-Sz
[This message has been edited by PSzalapski (edited 03-06-2002).]