Advertisement Jump to content
Sign in to follow this  

Camera moving question

This topic is 4883 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
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,

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
... or if you want a ready camera function:

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!