Jump to content
  • Advertisement
Sign in to follow this  
Helo7777

Quick question about rotation

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

hi all, What I want to do is rotate a mesh on its y axis by a normalized 2d vector (its direction). Is it just a matter of multiplying the mesh's rotation matrix by this vector? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
You need to multiply each vertex of the mesh by a rotation matrix. If its a Y rotation matrix, you need to multiply it by this matrix:

<table>
<tr>
<td>cos Theta</td><td> 0 </td><td>-sin Theta</td>
</tr>
<tr>
<td>0</td> <td>1</td> <td>0</td>
</tr>
<tr>
<td>sin Theta</td> <td>0</td> <td>cos Theta</td>
</tr>
</table>

[edit] dammit, tables don't work here. here is the matrix:

(cos T) 0 (-sin T)
0 1 0
(sin T) 0 (cos T)
where T is Theta (the angle your after.)

sorry the columns don't line up.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!