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


what's wrong with this camera code

Recommended Posts

twan    128
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