Friday, March 4, 2011

Assignment 3 (finished)

(Parts 1 and 2 are in the previous post)

3 and 4. Here's the code for the linear and non-linear transitions from complimentary colors. In the image the linear transition strips are the bottom three and the non-linear are the top three.

//linear transitions:
//I switched around the RGB values in setAttr in order to get the different colored strips
float $x = 1;
for ($i = 1; $i < 21; $i++) {
$ball = `shadingNode -asShader lambert`;
$color = $ball + ".color";
$objname = `polySphere -ch on -o on -r .5`;
setAttr $color -type double3 ($i/20.0) ($x) ($x);

xform -translation $i 0 0;

hyperShade -assign $ball;

$x = $x - .05;
}


//non-linear transition:
float $x = 1.0;
float $y = 21.0;
float $w = 5.0;

for ($i = 1; $i < 22; $i++) {
$ball = `shadingNode -asShader lambert`;
$color = $ball + ".color";
$objname = `polySphere -ch on -o on -r .5`;
setAttr $color -type double3 ($x) (5.0/$w) ($i/$y);

xform -translation $i 0 0;

hyperShade -assign $ball;

$x = $x - (1/$y);
$w = $w + (1);
};


5. Here's the image I made. I don't think it's quite what was wanted for this assignment, but I don't know how to make an easy-to-reproduce image that looks decent.

Steps to reproduce above image:

1. Open Photoshop and create a new file (command N).

2. Set dimensions to 640x480. Press Enter.

3. Create a new layer (command shift N).

4. Press P (pen tool) and create an "s" type shape. When finished, right-click and choose "Fill Path". Press Enter.

5. Repeat steps 3 and 4.

6. Next open the gradient tool (press G) and then the gradient editor. Change the start and end colors to whatever you want. Add three more colors in between. Have these colors make up the hues that would be in-between the start and end colors if they were in a color cube.

7. Create a new layer. With the gradient tool still selected, click and drag the mouse from the top of the image to the bottom and then let go. This will create a nice gradient with the colors you chose.

8. Move the gradient layer just above one of the layers with the "s" shape from step 4. Right click the gradient layer and select "Create Clipping Mask". This makes it so the gradient will be in the shape of the shape you made with the pen tool.

9. Repeat steps 6-9 for the other "s" shape.

10. Create another layer and fill it with white using the paint bucket tool (press G).

11. Go to Filter -> Sketch -> Chalk & Charcoal. Make sure both chalk and charcoal are is set to 6 and stroke pressure is 1. Press Enter.

12. Make sure the new layer is at the very top and then set the blending mode of that layer to Screen.

That concludes the directions.

Thursday, March 3, 2011

Assignment 3: Scripting and Color Space (not completed)

1. Here's the RGB color cube and code:

for ($z = 0; $z < 8; ++$z)
{
for ($y = 0; $y < 8; ++$y)
{
for ($x = 0; $x < 8; ++$x)
{
$ball = `shadingNode -asShader lambert`;
$color = $ball + ".color";
setAttr $color -type double3 ($x/8.0) ($y/8.0) ($z/8.0);
$objname = `polySphere -ch on -o on -r .05`;

xform -translation ($x/8.0) ($y/8.0) ($z/8.0);

hyperShade -assign $ball;
}
}
}


2. Here's the RGB color wheel:

float $rad = .1;
$h = 10.0;
$s = 1.0/8.0;

for ($j = 0; $j < i =" 0;" ball =" `shadingNode" color =" $ball" hue =" ($h" sat =" $s" vect =" <<$hue,">>;
vector $col = hsv_to_rgb ($vect);
setAttr $color -type double3 ($col.x) ($col.y) ($col.z);
$objname = `polySphere -ch on -o on -r $rad`;

xform -translation ($j/8.0) 0 0;
move 0 0 0 $ball.scalePivot $ball.rotatePivot;
xform -ro 0 ($i*10) 0;

hyperShade -assign $ball;
}
$rad = $rad + .01;
}


This is all I have done at this point. It's not that I'm necessarily having trouble with the assignment, I've just had a terribly unlucky week with having lots of homework as well as getting real sick. I suppose I'm going to have to use a late day on this project. I figured I would just post what I have so far though.

Sunday, February 27, 2011

Journal Post 6

The spheres now get smaller in each ring as they near the center. I've been trying to also decrease the space between the rings so they're not so spread out near the center, but I'm going to give up on that for now. I want to get the colors to work first, then if I have time I'll work on the spacing some more.

The hsv to rgb code has been giving me some trouble. I feel that I need to declare it as a vector variable, but I can't figure out how to do that.

float $rad = .01;

for ($j = 1; $j <>

{

for ($i = 1; $i <>

{

$ball = `shadingNode -asShader lambert`;

$color = $ball + ".color";

vector $vect;

hsv_to_rgb <<$i, $j, .5>>;

//setAttr $color -type double3 ($vect.x) ($vect.y) ($vect.z);

$objname = `polySphere -ch on -o on -r $rad`;

xform -translation ($j/8.0) 0 0;

move 0 0 0 $ball.scalePivot $ball.rotatePivot;

xform -ro 0 ($i*10) 0;

hyperShade -assign $ball;

}

$rad = $rad + .01;

}