Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

Matrix.RotationAxis Question

Started by k00k Mar 28, 2006 at 10:05 AM 2 replies 2.7k views
Original Post
k00k
k00k
Guys im currently writting a graphics engine wrapper for MDX. and I have implemented my own Matrix Struct as I have that fairly done I need some help with a few of the Methods inside the Matrix Functions in DirectX. First Does anyone have the (Math) behind Matrix.RotationAxis(vector, float)? I need to add that method to mu struct but im not sure of what it is doing .. does is just take the vector and add the angle to the vectors X,Y and Z positions? also im trying to override Vector3.TransformNormal as well. if anyone can help I would apreciate it thanks
jamba
jamba
The <a href="http://skal.planet-d.net/demo/matrixfaq.htm#Q38>Matrix and Quaternion FAQ will probably help you.
k00k
k00k
Ok so nobody know's whats going on behind the doors of D3DXMatrixRotationAxis's method? thats basically the only one I need I figured out the TransformNormal Method.
Egelsoft
Egelsoft
Well the RotationAxis function builds a rotaion matrix that rotates an object an arbitrary amount an arbitrary axis :) now we got that out of the way... to the math!

Have you implemented Quaternions yet? Oh hell you can use DX's quats, just do like so:
Quaternion rotation = Quaternion.RotationAxis(<your axis here>, <your angle here>);return Matrix.FromQuaternion(rotation);


In case you haven't implemented Quaternions yet, you might wanna look here. It's bad graphics but it's a good resource.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.