Advertisement

How to move the camera?

Started by February 09, 2002 05:21 AM
1 comment, last by ZitherMan 23 years ago
Hi! I have done gamelesson 4 (loading MD2 and MS3D files) and now i wonder how to move the camera in a easy way? I want to place the camera behind the object on the screen no matter how it is rotated and i fugured i could do this by simply not using glLoadIdentity between the placement of the object and the camera (and using glTranslatef to go back some units on the objects x-axis).
----------------------------
When hell freezes over it will be a pretty cool place to snowboard
I don''t know...i am using glLookAt as a camera...i am not sure if this is the right thing to do, but it works in my projects.....


Advertisement
If you want to do things without using GLU, you can always do...

  glMatrixMode(GL_PROJECTION);glRotatef(1.0f,1.0f,1.0f); //rotates cam on x, y, and z axisglTranslatef(1.0f,1.0f,1.0f); //moves cam somewhere in the world  


Of course, thats just one simple way of doing it. both the GL_PROJECTION method I showed you, as well as the gluLookAt method presented by ironhell3 are fairly quick fixes. There are other ways of moving the camera in OpenGL as well.

This topic is closed to new replies.

Advertisement