Skip to content

Instantly share code, notes, and snippets.

@ayoburgess
Last active August 28, 2017 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayoburgess/8143786da3d8d65d333c1e897951c755 to your computer and use it in GitHub Desktop.
Save ayoburgess/8143786da3d8d65d333c1e897951c755 to your computer and use it in GitHub Desktop.
Additional rotation on top of instances in Houdini
#include "math.h"
// additional rotation on top of instance placements
vector rot_variance = chv("rot_variance");
float x_rot = fit(rand(@ptnum+1), 0, 1, 0, rot_variance.x);
float y_rot = fit(rand(@ptnum+2), 0, 1, 0, rot_variance.y);
float z_rot = fit(rand(@ptnum+3), 0, 1, 0, rot_variance.z);
vector rotation = set(x_rot, y_rot, z_rot);
rotation = radians(rotation);
p@rot = eulertoquaternion(rotation, XFORM_SRT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment