Jump to content

how to rotate vectors?


curveU

Recommended Posts

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.

Link to comment
Share on other sites

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

  • Like 4
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?:blink:

Edited by SYmek
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...