PDA

View Full Version : transformations



eckiller
03-23-2000, 03:25 PM
Is it possible to truly move the camera in opengl? It seems to me its
only possible to move the world around the camera to simulate cmera
moving effects. If it is possible to transform the camera, how? All my
transformations only effect my models. I read that glulookat just
encapsulates model transformations to make it "look" like the camera is
moving. This has been in the back of my mind for awhile and has not
hindered my programming but i would like to know once and for all.

Frank

P.S. by move i mean at run time move the camera in relation to user input.

Gorg
03-23-2000, 08:54 PM
There is no camera. But you can think of it that way, or you can think of it like moving objects from a reference point, and you actually get the same results.

Just use the one that makes you understand how you can place objects.

Hude
03-23-2000, 09:58 PM
Originally posted by eckiller:
P.S. by move i mean at run time move the camera in relation to user input.

Well yeah, there are different ways to implement a camera. I personally think that a camera view is always just an orientation (including rolling) with some field of vision.
With glLookAt you'll do just fine. If you need a first-person camera, just keep track of position and target and alter them with the user input. Not too hard. If the player turns, rotate target using position as origin. If he walks forward add the direction vector multiplied by some constant to position and target. And so on. Also you can use camera fov tricks with gluPerspective.