vex

vex

VEX: Phyllotaxis


No Comments

int num = chi("num"); float height_ratio = chf("height_ratio"); float radius_ratio = chf("radius_ratio"); float scale_ratio = chf("scale_ratio"); float phi = radians(26.5);//(1 +sqrt(5)) / 300.0; float ang = 2 * $PI * (phi – 1) / phi; int step = chi("step"); for(int i=0; i<step; i++){ int pt = addpoint(0, set(0,0,0)); setpointattrib(0, "connect", pt, i); } for(int i=0;

Read More

houdini, scripts, Uncategorized, vex

VEX: Bend Wrangle


No Comments

Taken from https://tosinakinwoye.com/2017/01/23/houdini-vex-snippets/ //Input is a line //Resample SOP on line for more points //Activate curveu attrib in resample SOP //Remap curveu to shape of bend @curveu=chramp(“ramp”,@curveu); float bamt = chf(“bend_amt”); //bend amount vector benddir = chv(“bend_dir”); //bend direction @P+= benddir * bamt * @curveu;

Read More

houdini, scripts, vex

VEX: SOP Rotation


No Comments

f@speed = fit01(rand(@ptnum), ch(‘minSpeed’), ch(‘maxSpeed’)); float angle = (ch(‘angle’)+@ptnum)*@speed; vector axis = sample_direction_uniform(rand(@ptnum*ch(‘seed’))); @orient = quaternion(angle, axis);

Read More