# quake style camera

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

-thanks

I am setting up a tutorial for this, but I havent gotten around it yet…
http://cheo.resnet.wayne.edu/terrain.zip

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.

-thanks

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…

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

Actually, I just tested a little code…

``````tempX = (Camera-&gt;m_View[1]  - Camera-&gt;m_Position[1]);

Camera-&gt;m_Position[1]	+= (tempX * speed);
Camera-&gt;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-&gt;m_View[0] - Camera-&gt;m_Position[0])*direction; // X
tempY = (Camera-&gt;m_View[1] - Camera-&gt;m_Position[1])*direction; // Y
tempZ = (Camera-&gt;m_View[2] - Camera-&gt;m_Position[2])*direction; // Z

/////////////////////////////////////////
// Moves camera forward and backward.
Camera-&gt;m_Position[0]	+= (tempX * speed); // X
Camera-&gt;m_View[0]		+= (tempX * speed); // X
Camera-&gt;m_Position[1]	+= (tempY * speed); // Y
Camera-&gt;m_View[1]		+= (tempY * speed); // Y
Camera-&gt;m_Position[2]	+= (tempZ * speed); // Z
Camera-&gt;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