VEX: How could I move a point along Normal?

   17935   4   1
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Hello;

How could I move a specified point along it's Normal, using point wrangle?
Here is my scene :

Attachments:
Capture.JPG (194.7 KB)
Move Along Normal_01.hip (82.2 KB)

Masoud Saadatmand (MSDVFX)
User Avatar
Member
8521 posts
Joined: July 2007
Offline
just multiply normal vector by the amount and add to P, set group only to points you want to move

Attachments:
Move Along Normal_01_fix.hip (88.5 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Thank you.
Masoud Saadatmand (MSDVFX)
User Avatar
Member
7737 posts
Joined: Sept. 2011
Offline
You're using pointattrib and setpointattrib wrong. If you are running over points, then you can just bind. You are also using the wrong signature of chf. use float chf( string ) not float chf( string, float ). The signature you are using is to specify the point in time of an animated channel from which to sample the parameter.

@P += @N * chf('dist');

pointattrib is the old way of getting a point attribute, it is only used if you need the know whether the import was successful. Use point() if you need to get a value from a point other than the current one (or from a different input). Remember, an attribvop set to ‘runover points’ is already a loop. The code block is the code executed per ‘iteration’ of the loop, which for points is per point. Any bind (@varname) will refer to the current point's attributes to read or write.

setpointattrib is used for when you need to write the value to a point other than the current point. Generally it should never be used when run-over is set to points, as you already have a point to write to, the current point. The exception to this rule is when creating geometry per-point, and you need to set attributes of newly created points. Other cases are when you don't know the name of the attribute to be written in advance, but this can be handled in different ways.
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Thank you “jsmack”, good points.
Masoud Saadatmand (MSDVFX)
  • Quick Links