Advertisement Jump to content


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


D3DXMatrixLookAtLH ?!?

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

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!