Xen Custom Shader Parameter: Fixed Color Distribution

Xen Custom Shader Parameter: Fixed Color Distribution

martinmichl
Enthusiast Enthusiast
518 Views
1 Reply
Message 1 of 2

Xen Custom Shader Parameter: Fixed Color Distribution

martinmichl
Enthusiast
Enthusiast
Hello I would like to create cables with Xgen and I am stuck getting the color right. I am looking of a solution to distribute 4 predefined colors to a description. that means I would like blue,red and yellow to be randomly distributed amongst them. it should not be color varieties nor random colors. help would be much aprechiated thnx Martin
0 Likes
Accepted solutions (1)
519 Views
1 Reply
Reply (1)
Message 2 of 2

Michael_Todd
Alumni
Alumni
Accepted solution

$blu = [0,0,1]; #color

$yel = [1,1,0]; #color

$red = [1,0,0]; #color

$rand=rand(0,3);

wchoose($rand, $red,0.33, $yel, 0.33, $blu,0.33)

 

The  values after each variable, 0.33, control the weighting of the choice, so you could bias Blue over the other two by increasing it's weight (The weight has to normalize to 1)

 

cheers



Michael Todd

XGen Product Owner and Designer