curveU Posted September 29, 2009 Share Posted September 29, 2009 Hi everyone, I need to rotate a vector with a certain angle based on an axis. I'm not very familiar with matrix math. It seems that "rotate" VOP is the right node for this, but I just can't make it work. Could anyone here show me a simple example? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
jacob clark Posted September 29, 2009 Share Posted September 29, 2009 Hi Curve, Contrary to the labeling, using a Quaternian is the easist way to do this. 1) Lay down the Quaternion VOP 2) Plug in the axis and angle parms (I can't remember if the angle is degrees, or radians) 3) Convert the Quaternian to a Matrix3, you can use a 4, but not needed for rotations... 4) Muliply your Vector by the Matrix3, make sure your Vector is the first input, and Matrix is the second. 5) BAM!! Rotating Vectors! I am sure there is a great math explination out there for how this works. If you know what it is fill me in! cheers, -j 4 Quote Link to comment Share on other sites More sharing options...
malexander Posted September 29, 2009 Share Posted September 29, 2009 I am sure there is a great math explination out there for how this works. If you know what it is fill me in! Basically, a quaternion can be used to represent an orientation, just like a rotation matrix. So going from a quaternion to a rotation matrix is pretty trivial (in math terms). And since you can construct a rotation matrix from an axis and a rotation angle, you can do the same for a quaternion. That being said, it'd be a lot easier if there was a way to directly create a rotation matrix from an axis and angle without going through the Quaternion VOP (asset!). For way more information than you're probably looking for, check here. Quote Link to comment Share on other sites More sharing options...
symek Posted September 29, 2009 Share Posted September 29, 2009 (edited) That being said, it'd be a lot easier if there was a way to directly create a rotation matrix from an axis and angle without going through the Quaternion VOP (asset!). Isn't the Rotate Vop with angle and axis input right for that purpose? Edited September 29, 2009 by SYmek Quote Link to comment Share on other sites More sharing options...
curveU Posted September 30, 2009 Author Share Posted September 30, 2009 Thanks everyone. I made it work with Jacob's approach. But I'm still a little confused about the math knowledge of vector,quatenion, matrix,etc. I will definitely do more search on the web, but if anyone here could provide some good tutorials for this, that will help me a lot:) Quote Link to comment Share on other sites More sharing options...
jacob clark Posted September 30, 2009 Share Posted September 30, 2009 Isn't the Rotate Vop with angle and axis input right for that purpose? Well, hey, look at that! I always got scared away by the big Matrix input field... Hehe, skip steps 1, 2, and 3! Cheers for catching that, Symek. -j Quote Link to comment Share on other sites More sharing options...
curveU Posted October 14, 2009 Author Share Posted October 14, 2009 so... how to use "rotate" VOP? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.