Jump to content
Sign in to follow this  
Baldric

moving points along normals using wrangle sops?

Recommended Posts

Hello everyone,

 

I am trying to move some points in a group along their normals, but want to try out doing so by a wrangle sop instead of the point sop, as I have heard that the point sop is getting a bit out of date. Besides it would be good to learn a bit more VEX code...

However, I am new to VEX, and am struggling to get things to work. I know it is probably very simple, so my question is: how do I do this the proper way?

 

Thanks,

 

Doug

Share this post


Link to post
Share on other sites

Thanks Dedeks

 

Worked like a charm, and the tutorial was great!

 

Cheers!

 

Doug

  • Like 1

Share this post


Link to post
Share on other sites
On 06/10/2015 at 1:19 AM, dedeks3000 said:

1 - For a good introduction to vex expressions and wrangles :

 

     http://www.sidefx.com/index.php?option=com_content&task=view&id=2512&Itemid=254

 

2 - To move points along normal , try this:

    

     v@P1 = ch("scale") * @N;

     @P += @P1;

 

     or

 

    @P += ch("scale") * @N;

I might be wrong but you should normalize the Normal vector first no ?

 

vector moveAlongV(vector position;vector norm; float dist){
    return position += normalize(norm) * dist;
}

Share this post


Link to post
Share on other sites
On 11/25/2017 at 8:07 PM, akelian said:

I might be wrong but you should normalize the Normal vector first no ?

 

vector moveAlongV(vector position;vector norm; float dist){
    return position += normalize(norm) * dist;
}

Yeah! I think so.

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
Sign in to follow this  

×