Jump to content
  • Advertisement
Sign in to follow this  
resle

[Matrices] World working, View behaving strangely

This topic is 3562 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've finished setting up a movement control system for a generic 3d entity in 3d space. It simply allows to have a pos[x,y,z] rot[x,y,z] vector and move it around by rotating it and pedaling or backpedaling in the direction it's facing. (more details here: http://www.gamedev.net/community/forums/post.asp?method=reply&topic_id=515178 ) For each object onscreen, consequently, I've a d3dmatrix that I apply to D3DTS_WORLD before drawing it. It works perfectly and I can fly objects around with perfect control. But then, when I apply another matrix of the same type to the "camera" by setting D3DTS_VIEW instead (of course before drawing anything), it doesn't behave the same way. The camera doesn't pedal/backpedal properly and I can't even properly describe the way it translates/rotates. The part of code that finalizes a matrix for a moveable entity looks like this: // TRANSLATE D3DXMatrixTranslation(TranMatrix,entity_posx,entity_posy,entity_posz); // ROTATE USING QUATERNIONS D3DXQuaternionRotationYawPitchRoll(RotQuat,entity_roty,entity_rotx,entity_rot.z); D3DXMatrixRotationQuaternion(RotMatrix,RotQuat); D3DXMatrixMultiply(FullMatrix,RotMatrix,TranMatrix); Anything utterly wrong here? Thanks in advance a.

Share this post


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