Jump to content

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

Link to comment
Share on other sites

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;

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

  • 2 years later...
  On 10/5/2015 at 11:19 PM, 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;

Expand  

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;
}
Link to comment
Share on other sites

  • 1 year 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...