Jump to content
isah_voodoo

subtracting centroid using vex

Recommended Posts

Hello,

I have run into a fairly annoying problem that I am able to do in vops but in vex I am not getting the desired results.

I am simply trying to subtract the current position from the objects center and set it to v@v

It looks like it is subtracting something but the vectors don't look like they are pointing directly at the center. I am doing this:

v@P2=point(1,"P", 0);
v@v=@P2-@P*22;

 

I have the centroid being plugged into input two of the wrangle.

What am I missing here ?

Thank you

centroid_sub_vel.hip

Share this post


Link to post
Share on other sites

not in front of houdini atm, but I guess you need brackets around (@P-@P2) -> order of operations

Share this post


Link to post
Share on other sites

Hi Matt,

It looks like it's an order of operations thing. If you wrap @P2-@P in brackets it seems to work fine

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

×