PDA

View Full Version : Camera in openGL



08-20-2005, 05:41 AM
anyone knows how to create an interactive camera in openGL responsed to the keyboard input, like 'W' means going forward, 'S' means going backward, 'D' ratate the scene clockwise, 'A' ratate the scene anti-clockwise.

Thanks in advance

powerpad
08-20-2005, 08:32 AM
create a class that does the transformation for you

jasso
08-21-2005, 07:57 PM
The Red Book (also known as the OpenGL Programming Guide) is your friend, especially the chapter on viewing. It'll tell you how to position the camera and move it around in your scene, or, alternatively, fix the camera's position and move the objects in the scene.

If you don't have a copy of the Red Book I believe you can find HTML and PDF versions of an older edition on this site. But get a copy if can swing it -- it's essential if you're serious about learning OpenGL.

orion
09-22-2005, 10:33 PM
Hi!
If you didn't find it yet, this is the code i think you need.
A c++ class just named Camera that allows you to move or strafe in all directions you want.

http://twiki.dsi.uniroma1.it/twiki/view/Grafica3d/WebHome/camera.zip

I hope it will help,
bye