View Full Version : quake style camera

08-14-2002, 08:13 AM
could some one post a link to some tutorial about how to make a quake style camera system?


08-14-2002, 09:14 AM
I am setting up a tutorial for this, but I havent gotten around it yet...
But you can download some of my code that uses it...

Good luck.

08-14-2002, 01:05 PM
I think this is quite easy isn`t it ?
One just have to consider the direction of the vector that is defined by the cam position and some point on the 'viewing line'.
At least if you take the xz-plane as a reference it should be easy.

08-16-2002, 05:27 AM
mancha, thanks for your camera code, but can you go upwards with it?
I'm not sure if I put it right but I can't do that (maybe I should take a closer look at it and not just implement, I'm on a little rush now).

08-16-2002, 05:40 AM
heh, I see you haven't implemented it to go upwards but I fixed that and now it works fine.


08-16-2002, 09:11 AM
No, I did not make it go upwards 'cause I have not had the need... But it should be a very simple task now that I gave you the code for going to the sides, forward and backward...


I am glad it helped...

[This message has been edited by mancha (edited 08-16-2002).]

08-16-2002, 09:37 AM
Actually, I just tested a little code...

tempX = (Camera->m_View[1] - Camera->m_Position[1]);

Camera->m_Position[1] += (tempX * speed);
Camera->m_View[1] += (tempX * speed);

Something like that should give you up or down movement depending on where your mouse is pointing...

Or place this code in your MoveCamera function...

// Computing the direction of our view.
tempX = (Camera->m_View[0] - Camera->m_Position[0])*direction; // X
tempY = (Camera->m_View[1] - Camera->m_Position[1])*direction; // Y
tempZ = (Camera->m_View[2] - Camera->m_Position[2])*direction; // Z

// Moves camera forward and backward.
Camera->m_Position[0] += (tempX * speed); // X
Camera->m_View[0] += (tempX * speed); // X
Camera->m_Position[1] += (tempY * speed); // Y
Camera->m_View[1] += (tempY * speed); // Y
Camera->m_Position[2] += (tempZ * speed); // Z
Camera->m_View[2] += (tempZ * speed); // Z

[This message has been edited by mancha (edited 08-16-2002).]

08-17-2002, 04:04 PM
There are some excelents tutorials for camera moving. Check out in www.gametutorials.com (http://www.gametutorials.com)

download the camera tutorials. (are 4 i think)

08-17-2002, 05:14 PM
I know those tutorials and I did not think their mouse implementation was too efficient... http://www.opengl.org/discussion_boards/ubb/frown.gif
But I will tell you that I learned from them. So I have to give them alot of credit...