Search
  • Josh

VEX SNIPPETS Pt.1

Updated: Jun 17, 2019

Some helpful vex that I use on the daily


1: Center Pivot and Move to Origin

in a pointwrangle..


vector centroid = getbbox_center(0);

vector dist = centroid - 0;

v@P -= dist;


2: Random Normal

in a pointwrangle..

float nx = fit01(rand(@ptnum),-1,1);

float ny = fit01(rand(@ptnum+1),-1,1);

float nz = fit01(rand(@ptnum+2),-1,1);

v@N=set(nx,ny,nz);


3: Blend Positions

in a pointwrangle..


vector pos1 = v@P;

vector pos2 = point(1,"P",@ptnum);

float mixbias = chf("mix_bias");


v@P=lerp(pos1,pos2,mixbias);


4: Whitehair Setup

in a primwrangle...


if(rand(@id)<0.2){ i@whitehair=1; }else{ i@whitehair=0; }


5: Custom Width Along Curve

in a pointwrangle.. also needs a uvtexture node set to rows and columns running over points before it


float blend = chramp("blend",@uv[0]);

float width = chf("width");

@width=blend*width;


  • Grey LinkedIn Icon
  • Grey Vimeo Icon
  • Grey Instagram Icon
  • Artstation
  • Grey Tumblr Icon