movingWorld

Whenever I try to make the camera move and the world stay still, the camea is stationary and the world moves around. How do I prevent that?

Well, what is the difference?

Are you sure that is what happens? The effect of moving the camera is that the scene as a whole is moved. The Tech FAQ has a good suggestion on how to deal with camera movement. See sec. 8.060

Ritchie

Reverse the direction around, to move through the world you have to move the world the oposite way.

If you press forewards in your program then the world move forewards, therefore you appear to move backwards. Translate the negative of this and all should be well.

glLoadIdentity();

glRotatef(Camera.bob, 0.0,0.0,1.0); // not needed
glRotatef(Camera.xrot,1.0,0.0,0.0);
glRotatef(Camera.yrot,0.0,1.0,0.0);

glTranslated(-Camera.x,-Camera.y,-Camera.z);

Here is a snippet of my code, you see I hold the position in Camera but for renderinmg purposes these have to be negative to move the world.