Sign in to follow this  
Helo7777

Quick question about rotation

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this