Skip to content

Instantly share code, notes, and snippets.

@ayoburgess
ayoburgess / random_instance_rotations.h
Last active Aug 28, 2017
Additional rotation on top of instances in Houdini
View random_instance_rotations.h
#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);
@ayoburgess
ayoburgess / tag_in_camera_points.h
Last active May 24, 2019
Houdini VEX - Tag points outside of camera frustum
View tag_in_camera_points.h
string camera = chs("camera");
vector screen_pos = toNDC(camera, @P);
float left_padding = chf("left_padding");
float right_padding = chf("right_padding");
float top_padding = chf("top_padding");
float bottom_padding = chf("bottom_padding");
f@outside = 0;
int outside_left = (screen_pos.x < (0 - left_padding));
@ayoburgess
ayoburgess / .tcshrc
Last active May 25, 2017
tcsh prompt
View .tcshrc
set prompt="\n%d %D-%w-%Y %P\n[%n@%m | %~]\n(tcsh) > "
@ayoburgess
ayoburgess / .bashrc
Last active May 25, 2017
bash prompt
View .bashrc
# prompt
export PS1="\n\D{%a %d-%b-%Y} \t\n[\u@\h | \w]\n(bash) $ "
@ayoburgess
ayoburgess / wacom_southpaw.sh
Last active Apr 25, 2017
Wacom Tablet Left-handed, Right-click/Middle-click Setup
View wacom_southpaw.sh
# Left-handed
xsetwacom --set "Wacom Intuos Pro M Pen stylus" Rotate half
# Set right click to button 2 (button closest to tip)
xsetwacom --set "Wacom Intuos Pro M Pen stylus" Button 2 3
# Set middle click to button 3
xsetwacom --set "Wacom Intuos Pro M Pen stylus" Button 3 2
You can’t perform that action at this time.