Advertisement

OpenGL : Kamera movement

Started by March 09, 2001 02:19 PM
5 comments, last by Billi Berserker 23 years, 8 months ago
I have a great Landscape without light. I don''t know how to move the Camera throug the Landscape. This wasn''t a real problem until I wants to put a light in. Now it isn''t enough if I rote the Landscape because the light doesn''t rotate. so I have to rotate and Move the Camera. But how?
The gluLookAt function defines a viewing transformation.

void gluLookAt(
GLdouble eyex,
GLdouble eyey,
GLdouble eyez,
GLdouble centerx,
GLdouble centery,
GLdouble centerz,
GLdouble upx,
GLdouble upy,
GLdouble upz
);

Parameters
eyex, eyey, eyez
The position of the eye point.
centerx, centery, centerz
The position of the reference point.
upx, upy, upz
The direction of the up vector.


You can use this func as an eyes(camera)! I USE IT!
Advertisement
I tried it and I must say that it doesn''t work.
Can you explain the parameters?
where must I set the functiòn?
before or after drawing?
Did you try using glTranslatef(x,y,z) ?
T.J Birand
Yes I did.
after translation and drawing I tried to set the Camera.
But this didn''t worked.
gluLookAt(camerapos.x,camerapos.y,camerapos.z,cameratarget.x,cameratarget.y,cameratarget.z,0,1,0);

Advertisement
Anyone have any tutorials that explain the math behind decomposing yaw and pitch into a line of sight vector? I''ve got a pretty strong understanding of vectors (from physics class and the flipcode geometry primers), but I don''t really have a strong grasp of matrix mathematics (or any ). I was able to modify the camera source from code colony linked to in the frames of nehe''s site to support mouselook, but I would like to really understand the math behind it.

This topic is closed to new replies.

Advertisement