opengl 3d camera Q?
BlitzMax Forums/BlitzMax Programming/opengl 3d camera Q?
| ||
im coding my own 3d engine and i am wondering about the camera position and rotation how is this done in opengl |
| ||
Frmo what i know, you need to SUBTRACT the angle you want the camera to point to, from the entities. See terrabit's code for an idea.. im away from source again so i cant post how i did it :( |
| ||
gluLookAt is the command you want. It takes 9 floats as parameters - the first three are the x,y,z co-ordinates of the camera, the next three are the x,y,z of the target, the last three are the x,y,z of a vector specifying which way is 'up'. |
| ||
Woot! http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=10 |
| ||
hey, i never knew of that command! I went and made my render routine rotate everything by a camera's angle!!! ^.^ |