Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Houdini VEX - Tag points outside of camera frustum
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));
int outside_right = (screen_pos.x > (1 + right_padding));
int outside_top = (screen_pos.y < (0 - top_padding));
int outside_bottom = (screen_pos.y > (1 + bottom_padding));
if (outside_left || outside_right || outside_top || outside_bottom) {
f@outside = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.