Jump to content
Sign in to follow this  

Ramp mask Control on a GRID in VEX

Recommended Posts

Hi all,

Im looking to control the colors on a grid ( YZPlane) in  VEX to create a mask (will be used to create a group of the un-masked area),

My approach is to use relpointbbox for the position and 3 chrand's for each side profile, Im looking to see if someone has done something similar.

My current solution (and for those interested) is fairly simple but gives good control.

vector bbox = relpointbbox(0,@P);

float Right = chramp('RightRamp',bbox.y);
float Left = chramp('LeftRamp',bbox.y);
float Top = chramp('TopRamp',bbox.z);
//Init to 0
v@Cd = 0;

//Top Ramp
if(bbox.y<Top ) @Cd.g=1;
//Left Ramp
if(bbox.z<Left/2+.5 && bbox.z>.5 ) @Cd.r=1;
//Right Ramp
if(bbox.z > (1-Right)/2  && bbox.z<.5 ) @Cd.b=1;



Edited by Trilec

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this