Tuesday, March 8, 2011

Assignment 3 #3 Linear

*Note: This code does not produce them all, I just lined them up to look nice.
select -all;

doDelete;
string $name;
string $name2;
//Attempted int $red,$green,$blue but it wasn't working so stuck with float
float $red;
float $green;
float $blue;
//Wanted these to drape since I made a sort of keyboard last time.
for ($y=-20;$y<20.0;$y++)
{
$red = 0.0;
$green = 0.0;
$blue = 0.0;
//Got help that positive and negative variables could adjust the colors.
$red -= ($y*0.05);
$green += ($y*0.05);
$blue -= ($y*0.05);
//The rest of the code basically follows the assigned shaders from the previous assignments.
$name = `shadingNode -asShader blinn`;
$name2 = $name + ".color";
setAttr $name2 -type double3 ($red) ($green) ($blue);
polyCube -w .03 -h .03 -d 0.5 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;
xform -translation 0 (0.05*$y) 0;
hyperShade -assign $name;
}
;

Had lots of problems with this. Always saw the default red color and black. I wasn't able to get it to go through white or gray, just solid black. 

No comments:

Post a Comment