Author: gareth

houdini, python, scripts

Python: Phyllotaxis


No Comments

node = hou.pwd() geo = node.geometry() # Add code to modify contents of geo. # Use drop down menu to select examples. from math import radians, sqrt, sin, cos numpoints = 200 angle = 137.508 cval = 0.2 for i in range(numpoints): theta = radians (i * angle) x = cval * sqrt(i) * cos(theta)

Read More

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

Uncategorized

VEX: Matrix


No Comments

Move to origin // Get center of the oject bounding box (centroid) vector min = {0, 0, 0}; vector max = {0, 0, 0}; getpointbbox(0, min, max); vector centroid = (max + min)/2.0; // Build and apply transformation matrix vector translate = centroid; vector rotate = {0,0,0}; vector scale = {1,1,1}; matrix xform = invert(maketransform(0,

Read More

Uncategorized

HScript: Copy Loops


Scripts: Simple fit01(rand(detail(“../foreach_begin1_metadata1”, iteration, 0)),0,2) Automatic number of inputs (fixed) fit01(rand(detail(“../foreach_begin1_metadata1”, iteration, 0)),0,(opninputs(“.”)-1))

Read More

learning, useful

CG Cinematography


This awesome book by Chris Brejon is a great resource for Lighting and Cinematography techniques and fundamentals. https://chrisbrejon.com/cg-cinematography/

Read More

houdini, python, scripts

Python: Split Into Groups


No Comments

This little script for Houdini is one I’ve had knocking about and thought might be useful to throw out onto t’interweb. Select the node at which you want to split out the groups and it will create a bunch of blasts and OUT nodes to separate out per group. import hou selectedNodes = hou.selectedNodes() for

Read More