Skip to content

Instantly share code, notes, and snippets.

@Limbicnation
Last active February 27, 2025 16:50
Show Gist options
  • Select an option

  • Save Limbicnation/6aae256de1706c2fa48719ef4f326607 to your computer and use it in GitHub Desktop.

Select an option

Save Limbicnation/6aae256de1706c2fa48719ef4f326607 to your computer and use it in GitHub Desktop.
VEX lattice-Structure
// From Algorithmic Design Workbook with Houdini https://app.gumroad.com/d/782fb33b45a3bbc40fdc24d9196cb6ec
// https://www.tokeru.com/cgwiki/index.php?title=HoudiniVex#Attributes_vs_variables
int npnt = nearpoint(1,@P);
vector targetpos = point(1, 'P', npnt);
float dist = distance(@P, targetpos);
float freq = chf('frequency');
float pos = chf('Position');
float amp = chf('amplitude');
float d;
float speed;
d = length(@P);
@density = sin(dist*freq)*amp;
@P += normalize(pos);
@Cd = @P;
@Cd.r = sin( @P.x * ch('scale'));
// Add wave deform
@d = length(@P);
@d *= ch('scale');
@speed = @Time*ch('speed');
@P.y = cos(@d+@speed);
// Add height
@P.y *= ch('height');
@P.x *= ch('amplitude');
@P.z *= ch('frequency');
@P.x *= sin(d*ch('Position')+speed);
// Add Falloff
@P.y *= chramp('falloff', @falloff);
@Limbicnation
Copy link
Author

gritty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment