Quote:
Originally Posted by Johanovski
Hi there!
I'm working in a OpenGL 3D app and I've just beaten my face against moving: how can this be done? I mean, how can one "simulate" the camera effect as if he's moving through the scenario? I've read somewhere that there are no "cameras" in OpenGL so, instead of moving the camera one has to move the whole scene (that mean all 3D objects in the scene)... Scary, really creepy, but seems to be the only way (hope to hear "not the only way!", but I'm getting faithless about this ^_^), so which is the less painful way to do this?
Any help will be really appreciated, I've never worked with 3D OpenGL before and I find it's quite difficult! Thanks in advance! 
|
A 3D scene is made up of objects. Each object has a matrix applied to it to move it from the origin (0,0,0) to some location in space.
One approach is to think about it that a camera is in essence just another matrix which globally applies to all objects.
For example, if you wanted to create a camera to move forwards you apply a matrix to all the objects to move backwards.
There is an excellent book specifically about making camera classes for games:
Real-Time Cameras
Try finding it second hand