Advertisement Jump to content


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


DX9, matrices

This topic is 5830 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 have no idea why my code isn''t working properly. IT runs, but the image won''t rotate. Here''s my matrices code: VOID SetUpMatrices(){ D3DXMATRIXA16 matWorld; //World Matrix D3DXMATRIXA16 matView; //View Matrix D3DXMATRIXA16 matProj; //Projection Matrix //Set up world matrix D3DXMatrixRotationY(&matWorld, timeGetTime()/150.0f); g_pD3DDevice->SetTransform(D3DTS_WORLD, &matWorld); //Set up view matrix D3DXMatrixLookAtLH(&matView, &D3DXVECTOR3(0.0f, 3.0f, -5.0f), &D3DXVECTOR3(0.0f, 0.0f, 0.0f), &D3DXVECTOR3(0.0f, 1.0f, 0.0f)); g_pD3DDevice->SetTransform(D3DTS_VIEW, &matView); //Set up projection matrix D3DXMatrixPerspectiveFovLH(&matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f); g_pD3DDevice->SetTransform(D3DTS_PROJECTION, &matProj); } here''s the whole thing:

Share this post

Link to post
Share on other sites
Your vertex format has the RHW flag specified which tells D3D that it doesn''t need to apply the transformation matrices to the vertices - A vertex format with RHW is you telling D3D "I''ve already transformed these vertices, you don''t need to - just draw them".

Check out the tutorials which come with the SDK, in particular the "matrices" one - you''ll notice that all the earlier tutorials use RHW, but as soon as they need to apply matrices they drop the RHW flag from the FVF code and vertex data...

Simon O''Connor
Creative Asylum Ltd

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!