Thursday, March 3, 2011

Its Just a line!

So for my linear transitions I used the color cube as a lot of help, especially with visualizing it. I also received some help from Andrew with the coloring of it.I ended up using cubes because they kinda melded together and made an awesome gradient effect.

select -all; delete;

string $name;
string $name2;

 float $r;
 float $g;
 float $b;
 int $x = 0;

for ($x=0;$x<15.0;$x++)
{
 $r = 0.0;
 $g = 1.0;
 $b = 0.0;

 $r += ($x*0.06);
 $g -= ($x*0.06);
 $b += ($x*0.06);

     $name = `shadingNode -asShader blinn`;
     $name2 = $name + ".color";
     setAttr $name2 -type double3 ($r) ($g) ($b);
     polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;
     xform -translation (0.25*$x) 0 1;
     hyperShade -assign $name;
}
;  



This code makes a transition almost like the hulk color scheme. It is kinda awesome and I really like it!


select -all; delete;

string $name;
string $name2;

 float $r;
 float $g;
 float $b;
 int $x = 0;

for ($x=0;$x<15.0;$x++)
{
 $r = 0.0;
 $g = 0.0;
 $b = 1.0;

 $r += ($x*0.06);
 $g += ($x*0.06);
 $b -= ($x*0.06);

     $name = `shadingNode -asShader blinn`;
     $name2 = $name + ".color";
     setAttr $name2 -type double3 ($r) ($g) ($b);
     polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;
     xform -translation (0.25*$x) 0 1;
     hyperShade -assign $name;
}


This one does a blue to yellow transition.


select -all; delete;

string $name;
string $name2;

 float $r;
 float $g;
 float $b;
 int $x = 0;

for ($x=0;$x<15.0;$x++)
{
 $r = 1.0;
 $g = 0.0;
 $b = 1.0;

 $r += ($x*0.06);
 $g += ($x*0.06);
 $b -= ($x*0.06);

     $name = `shadingNode -asShader blinn`;
     $name2 = $name + ".color";
     setAttr $name2 -type double3 ($r) ($g) ($b);
     polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;
     xform -translation (0.25*$x) 0 1;
     hyperShade -assign $name;
}


This one does magenta to orange.

No comments:

Post a Comment