top of page
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;

## Recent Posts

See All

VEX SNIPPETS Pt.2

Some more helpful vex that I'm trying to type less often 1: Move to set on Grid and Set Pivot to Origin in a point wrangle... vector centroid = getbbox_center(0); vector dist = centroid - 0; vector mi

Inverse Square Falloff

A while ago I was talking to an FX artist I work with who casually mentioned using inverse square law as a way to calculate falloff. I of course had no idea what he was talking about so I looked it up

bottom of page