I have a camera system setup that allows me to travel throughout the scene, but I am looking to have a fixed camera and allow the user to control a model in the scene. Using the MODELVIEW matrix mode, the translations/rotations move the camera instead of the model. I use glLoadIdentity() to reset the matrix and gluLookAt to position the camera. When it goes through the movement code, the camera goes to where the model is. If I use PROJECTION for the matrix mode, I just get a blank screen. Does anyone have any tutorials on this subject or know what might be going wrong? Basically, I am looking to have a fixed camera and quite a few fixed objects with one camera controlled object.
With a little work, the glPushMatrix() and glPopMatrix() worked, to an extent. I have the keyboard mapped to move forward/back/left/right using trig, and it works fine when I control the camera that way. When I try to control the model the same way, (passing the same X, Y, Z, Rotation Value that I passed when I was controling the camera) it won''t calculate the heading right. The rotation (left/right keys) work fine, but the up/down keys always move it in the same direction. The math works when the X, Y, Z, rotation values are applied to the camera (not using push/pop), but they don''t seem to work when they are applied to the model. Any ideas/suggestions?