Tuesday, March 1, 2011

Assignment 3 # 2 Color Wheel

So above I have the color wheel that I want to present as my final assignment. I originally wanted to try for a spiral thing but all the numbers were getting to annoying for me to figure out how to rotate them properly. But I made this and I really like how the colors are interwoven with each other. The colors also seem more vibrant in this version. I also have the proper color wheel but I want to submit this one instead. Unless I have to show the proper color wheel that'll come up later. I still like the top one alot better. 

OH and I also figured out why I kept only getting red on those other circles. On this area here:
$angle = $x * $rotation;
        $saturation = $y * $translate;
  $hue = $angle/360.0;

I had angle as "rotation" instead. I can't exactly explain why it was only giving me red and white but that's probably my fault for naming rotation and angle...preeeeeeetty much the same thing in my head. 

For this project I'm actually really glad we did the color cube. Most of the coding I got to actually put the colors on there, were from the color cube assignment when they were assigning shaders and whatnot. Then Kniss going over the hsv_to_rgb in class and set up the variables was extremely helpful. 



select -all;
doDelete;

float $radius = 60.0;
float $rotation = 360.0/60.0;
float $translate = 1.0/10.0;

string $name;
string $name2;

for ($x=0;$x<60.0;$x++)
{
    for ($y=0;$y<20;$y++)
    {
        $angle = $x * $rotation;
        $saturation = $y * $translate;
        $hue = $angle/360.0;

//Assigning the shaders. Similar to the color cube assignment, just using Blinn again.        
        $name = `shadingNode -asShader blinn`;
        $name2 = $name + ".color";

//Changing HSV to RGB
        vector $wheel = hsv_to_rgb(<<$hue, $saturation, 1>>);
        
//Setting the shaders to pick around the colors...ok mostly this was just copied from the Color cube but it looks like it works.
        setAttr $name2 -type double3 ($wheel.x) ($wheel.y) ($wheel.z);

//Making the spheres.
        polySphere -ch on -o on -r .03;
        
//Moving them to form a circle. 
        xform -translation $saturation 0 0;
//I messed around alot with the circle here. How it shapes etc. This makes it into the woven color circle.
        rotate -pivot 1 0 1 0 $angle 0;
        
//Assign them their shades similar to the color cube.
        hyperShade -assign $name;
    }
}
;


Artist color wheel WIP.

No comments:

Post a Comment