Wednesday, March 23, 2011

Color Wheel

Better late then never they say. So after some working on it some over Spring break and Andrews help on Monday I think I got it done. And going based off some of the cooler "painted" effects I made them cubes so they would intersect each other and give that somewhat painted feel.
 
float $rot = 360/30.0;
float $trans = 1.0/5.0;
string $name;
string $name2;
for ($x=0;$x<30.0;$x++)
{
    for ($y=0;$y<5;$y++)

    {
        $name = `shadingNode -asShader blinn`;
        $name2 = $name + ".color";     
        $angle = $x * $rot;
        $sat = $y * $trans;
        $hue = $angle/360.0;     

        vector $color = hsv_to_rgb(<<$hue, $sat, 1>>);
        setAttr $name2 -type double3 ($color.x) ($color.y) ($color.z);

        polyCube -w .3 -h .1 -d .3 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;

        xform -translation $sat 0 0;
        rotate -pivot .1 .1 .1 0 $angle 0;
        hyperShade -assign $name;

    }
}
;

No comments:

Post a Comment