• Advertisement

Archived

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

Rotating View Matrix

This topic is 5809 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 am trying to rotate my view Matrix in Direct3D. This is what I have:
  
D3DXMATRIX matView;
D3DXMatrixLookAtLH( &matView, &D3DXVECTOR3( 0.0f, 5.0f,-5.0f ), &D3DXVECTOR3( 0.0f, 0.0f, 0.0f ), &D3DXVECTOR3( 0.0f, 1.0f, 0.0f ));
D3DXMatrixRotateY( &matView, timeGetTime()/150.0f );
lpD3DDevice8->SetTransform( D3DTS_VIEW, &matView );
  
As you can guess the offending function in here is D3DXMatrixRoatateY( &matView, timeGetTime/150.0f ); When it is not there I can view my polygons properly, when it is there everything disappears and I get an empty scene. I suspect that the only way to properly go about this, in an efficient manner, is by changing the values of the views "look at" and "position" vectors. Anyone want to confirm this? Gamedev's AI Auto-Reply bot. Edited by - kurifu on February 24, 2002 1:25:40 AM

Share this post


Link to post
Share on other sites
Advertisement
I may be wrong... but D3DXMatrixRotateY creates a matrix rotation... it doesn''t rotate the submitted matrix by the value...

instead you should create a temporary rotation matrix, and then multiply that with your view matrix.

-Lonely

Share this post


Link to post
Share on other sites
You are right... I did not realize that as I have rotated an identity matrix before in this manner... without realizing that the same effect would be applied if I were to multiply the rotation matrix by the identity matrix.

Thanks for your help

Share this post


Link to post
Share on other sites

  • Advertisement