quake style camera

could some one post a link to some tutorial about how to make a quake style camera system?


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.

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.

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).

heh, I see you haven’t implemented it to go upwards but I fixed that and now it works fine.


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).]

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).]

There are some excelents tutorials for camera moving. Check out in www.gametutorials.com

download the camera tutorials. (are 4 i think)

I know those tutorials and I did not think their mouse implementation was too efficient…
But I will tell you that I learned from them. So I have to give them alot of credit…