Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

beeemtee

vector rotation in vex (vop)

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
On 7/16/2009 at 9:15 PM, sam.h said:

like so ... you are too fast anim :) (or google reader is too slow...)

rotate_vector.hip

Wow thanks so much! To be completely honest I don't understand how matrices works nor how your setup works but it solved my problem!

Share this post


Link to post
Share on other sites

You can do it without matrices by using a quaternion and a quaternion rotate like so :
quaternions are just vector 4 float (axis X, axis Y , axis Z, angle in radians)

qrotate_vector.hip

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