Jump to content
  • Advertisement

Archived

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

shakazed

Quaternionz0rz

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

I really don´t know jacks-bhind about quats so can I do like this...
    

D3DXMATRIX m_matOrientation; 
D3DXQUATERNION qR;  
D3DXQuaternionRotationYawPitchRoll(&qR, m_fYaw, m_fPitch, m_fRoll);  
D3DXMatrixAffineTransformation(&m_matOrientation, 1.25f, NULL, &qR, &m_vPosition );  
D3DXMatrixInverse( &m_matView, NULL, &m_matOrientation );  
iD3DDevice8->SetTransform(D3DTS_VIEW, m_matView);

    
...to rotate my camera? Is m_vPosition the camera´s lookat position?
Bad Monkey Productions

Share this post


Link to post
Share on other sites
Advertisement
ure trying to create a view matrix from camera yaw, pitch, roll and position right?

matrix operations are applied left to right, so just go

rotation matrix times translation matrix

use D3DXMatrixYawPitchRoll to make the rotation matrix and D3DXMatrixTranslate to make the translate matrix.

in what ure doing, m_vPosition is the camera''s position, not lookat. if you wanna do look at use D3DXMatrixLookat or whatever

MCLIN

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!