Camera moving question

Started by
3 comments, last by Zmax 18 years, 7 months ago
I want to create simple camera class that will fly over a heihgtmap using the keys and the mouse,..."free spirit".Can you please give,show me where can i find a tutorial that explains the needed cononcepts.(I don't need DirectInput).Thanks for reading http://www.gamedev.net/community/forums/images/icons/icon7.gif
Advertisement
the camera has four main vectors

look : z-axis of camera transform matrix, this is the direction that camera looks into

right : x-axis of camera transform matrix

up : y-axis of camera matrix

position: camera position in world coordinates

you can make transform matrix of the camera out of these vectors and calculate the View transform matrix (D3DTS_VIEW).

for example if you want to rotate the camera to the right, you must first build a rotation matrix around x-axis, transform the "look" vector, and calculate the other two vectors from the look vector :

right=cross( vector3(0.0f, 1.0f, 0.0f), look );
right = normalize(right);
up = cross( look, right );
up = normalize( up );

and build the camera view matrix out of them
for more info, check this out, http://www.toymaker.info/Games/html/camera.html

dark-hammer engine - http://www.hmrengine.com

... or if you want a ready camera function:

http://www.gamedev.net/community/forums/topic.asp?topic_id=301805
simple camera in GL.
enum Bool { True, False, FileNotFound };
Thanx guys you helped me alot...i have now a "free spirit" in my application. :)

This topic is closed to new replies.

Advertisement