Jump to content

vector rotation in vex (vop)


beeemtee

Recommended Posts

Hi,

I would like to ask, that how could I rotate a vector around another vector with VOPs? I want to rotate the up vectors around the normals of points in a VOP SOP. My first attempt was to construct a matrix with the lookat node, then rotate it around N with 'rotate' and then convert it back to a vector (last three floats of the 3x3 matrix). This network doesn't work perfectly and it seems to be a bit complicated comparing to the problem. My understanding of matrices, quaternions and the related part of vex is very shallow (as you probably already found out), but I would like to know and understand more about them, so this is why I'm trying to do it this way and not in SOPs.

thanks in advance!

bmt

Link to comment
Share on other sites

use rotate VOP to create matrix

axis would be normalised N

angle would be the angle you want (in radians)

plug the matrix to orient VOP "xform" input

plug the up vector to orient VOP "from" input

output of orient VOP is your rotated up vector around N by angle

or you can simply multiply up vector with that matrix, it will rotate it as well

Link to comment
Share on other sites

thanks guys for the quick reply!

this makes a lot more sense :) . the only issue was that I wanted to rotate the ups around the Ns and not the other way around, but the principle is correct, so a quick rewire in your example did the thing.

thanks again!

bmt

Link to comment
Share on other sites

hello I was wondering if any of you could help me with a similar problem I'm trying to work out in vops

I originally posted it in general Houdini questions and although it is to do with sprites I think needs the insight of a modeler.

http://forums.odforce.net/index.php?showtopic=9315

I've been scratching my head with it for a few weeks now so any new insights would be well appreciated

Link to comment
Share on other sites

  • 7 years later...
  • 7 months 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...