• Advertisement
Sign in to follow this  

Quick question about rotation

This topic is 3654 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
So what is the axis of rotation, the Y-axis or it's direction vector?

Share this post


Link to post
Share on other sites
the axis of rotation is the y axis. The direction vector maybe something like x = 0.707, y = 0.707

Share this post


Link to post
Share on other sites
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