Jump to content
  • Advertisement
Sign in to follow this  
Zmax

Camera moving question

This topic is 4815 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 http://www.gamedev.net/community/forums/images/icons/icon7.gif

Share this post


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

Share this post


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

http://www.gamedev.net/community/forums/topic.asp?topic_id=301805

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!