Jump to content
  • Advertisement
Sign in to follow this  

[Matrices] World working, View behaving strangely

This topic is 3673 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!