Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

k2uza

D3DXMatrixLookAtLH ?!?

This topic is 6486 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

Ok, I render a simple triangle on the screen. all fine and dandy. However, I want to be able to move the camera in tradition doom fashion (forward, backward, strafe left, strafe right, turn using mouse etc...) and I attempted using D3DXMatrixLookAtLH (...). So, I adjust the eyepoint, and lookat vectors whenever I get keyboard messages. However, it only works w/ 2 planes (y and z). Anytype of negative x movement (setting x below zero) doesnt move the camera to the left. So, I am kinda confused. Anyhelp would be appreciated. Here is some C/P: creating view matrix: D3DXMatrixLookAtLH( &matView, &eyepoint, &lookat, &D3DXVECTOR3( 0.0f, 1.0f, 0.0f ) ); changing vectors when w/ keyboard WM: case WM_LBUTTONDOWN: eyepoint.z -= 1; break; case WM_RBUTTONDOWN: eyepoint.x += 1; lookat.x += 1; case WM_MBUTTONDOWN: eyepoint.x -= .9; lookat.x -= .9;

Share this post


Link to post
Share on other sites
Advertisement

  • 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!