• Advertisement

Archived

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

Rotating XFiles using directX 9

This topic is 5151 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 have trouble rotating XFiles here is the code i have D3DXMatrixIdentity(&m_WorldMat); // Rotate around Y D3DXMatrixRotationY(&m_RotateY, Yaw); // Combine the matrix together m_WorldMat = m_RotateY * m_WorldMat; // Translate into position D3DXMatrixTranslation(&m_WorldMat, Pos3d.x, Pos3d.y, Pos3d.z); anyone got any ideas?? cheers

Share this post


Link to post
Share on other sites
Advertisement
// Translate into position
D3DXMatrixTranslation(&m_WorldMat, Pos3d.x, Pos3d.y, Pos3d.z);

When you do that, I _think_ that it overwrites what is currently in m_WorldMat. So you should probably (not sure) do it like this:


D3DXMatrixIdentity(&m_WorldMat);

// Rotate around Y
D3DXMatrixRotationY(&m_RotateY, Yaw);

// Translate into position
D3DXMatrixTranslation(&m_WorldMat, Pos3d.x, Pos3d.y, Pos3d.z);

// Combine the matrix together
m_WorldMat = m_RotateY * m_WorldMat;


And then SetTransform( D3DTS_WORLD, &m_WorldMat ).

Try that, it might just work!

Share this post


Link to post
Share on other sites

  • Advertisement