Jump to content
  • Advertisement


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


what's wrong with this camera code

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

Hi i made this code but it doesn''t work correctly. The camera moves but not in the correct direction only in the z direction. Who can tell me what''s wrong with this code ? void CCamera::MoveCamera() { D3DXVECTOR3 eye_vDirection, lookat_vDirection; D3DXMATRIX eye_mat, lookat_mat; eye_vDirection=eye_vector; lookat_vDirection=lookat_vector; D3DXMatrixTranslation(&eye_mat, xmove, ymove, zmove); D3DXMatrixTranslation(&lookat_mat, xmove, ymove, zmove); D3DXVec3TransformCoord(&eye_vDirection, &eye_vDirection, &eye_mat); D3DXVec3TransformCoord(&lookat_vDirection, &lookat_vDirection, &lookat_mat); eye_vector = eye_vDirection + eye_vector; lookat_vector = lookat_vDirection + lookat_vector; }

Share this post

Link to post
Share on other sites

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