# 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 on other sites

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

2 - To move points along normal , try this:

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

@P += @P1;

or

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

• 3
• 1

##### Share on other sites

Thanks Dedeks

Worked like a charm, and the tutorial was great!

Cheers!

Doug

• 1

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

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

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 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.

## Create an account

Register a new account