PDA

View Full Version : first person shooter camera question

colinisinhere
02-13-2003, 07:23 PM
I know i have asked this before but how exactly do you rotate and translate a camera for first person???

i am familiar with vectors but what exactly is a matrice?

thanks a lot

zsolti
02-13-2003, 09:56 PM
Try link :
http://www.gametutorials.com/Tutorials/OpenGL/OpenGL_Pg1.htm
Good luck.

MickeyMouse
02-14-2003, 04:32 AM
Actually camera doesn't move or rotate at all http://www.opengl.org/discussion_boards/ubb/smile.gif, camera is static and the environment is moving around it, ok it depends how you see it, but believe me your 3d card won't rotate camera but whole world except camera...

First you translate whole world by negated camera's position, then rotate whole world around y axis (the vertical one) and finally rotate whole world around x axis (the one from left to right). When you're dead instead of rotating around x do it with z axis, and that's all!

colinisinhere
02-14-2003, 07:06 AM
yes i know about the camera not actualy moving but... the only prob i have is that when i rot around x and y it rotates from the middle of the object not in the center... here is what my code was (the syntax isnt real, just showing you how my code was...)

translate(0.0f, 0.0f, z);
rot(x, 1.0f, 0.0f, 0.0f);
draw_World();
if(keys[UP]) z++;
if(keys[DOWN]) z--;
if(keys[left]) x++;
if(keys[right]) x--;

please please please help!

thanks

yaro_dup1
02-15-2003, 04:04 AM
Hi,

Did You check the link gived by zsolti ???
On GameTutorials.com is PERFECT tutorial for You. It is just this what You want!!!

cheers
yaro