Skip to content

Instantly share code, notes, and snippets.

@mimetaur
Created June 17, 2018 23:01
Show Gist options
  • Select an option

  • Save mimetaur/df386796a0a937ac62b9833dfbefee4a to your computer and use it in GitHub Desktop.

Select an option

Save mimetaur/df386796a0a937ac62b9833dfbefee4a to your computer and use it in GitHub Desktop.
Example of manipulating geometry with Houdini VEX
// using houdini's built in noise functions
// in the VEX expression language
// http://www.sidefx.com/docs/houdini/vex/index.html
// this is a Point Wrangle, meaning this code will be called
// for every point in the geometry
// each time it is called @P is equal
// to a different point in the geo
// params are located on the attribute wrangle
float noiseStrength = ch("noise_strength");
float noiseAnim = ch("noise_anim");
// the noise uses the point locations for a seed
// but added a fourth coord as a parameter to
// animate it without moving geo's points
vector4 coords = set(@P.x, @P.y, @P.z, noiseAnim);
// scale noise to -0.5 to 0.5
vector negativeOffset = set(-0.5, -0.5, -0.5);
vector theNoise = noise(coords) + negativeOffset;
// parameterize amount that noise affects geo
theNoise *= noiseStrength;
// displace geometry
@P += theNoise;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment