• Advertisement

Archived

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

Doing rotating per-vertex?

This topic is 5378 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 a rotation matrix,it gives right rotate result when multiply(second param in D3DXMatrixMultiply) to world matrix;but I need apply this matrix to every vertex,I use follow codes: v.x = v.x*m_matRotate._11 + v.y*m_matRotate._21 + v.z*m_matRotate._31 + m_matRotate._41; v.y = v.x*m_matRotate._12 + v.y*m_matRotate._22 + v.z*m_matRotate._32 + m_matRotate._42; v.z = v.x*m_matRotate._13 + v.y*m_matRotate._23 + v.z*m_matRotate._33 + m_matRotate._43; but got wrong result...why? We create world.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Because when you''re calculating v.y, v.x is already overwritten by the new value. When doing v.z, both v.x and v.y are already overwritten.

Use a temporary vector for source or result, and you should be okay.

Share this post


Link to post
Share on other sites
Well...Sorry for post a sooooo stupid question....I think I should have a rest now...Its already 2003/5/1 0:23...

We create world.

Share this post


Link to post
Share on other sites

  • Advertisement