Thursday, February 17, 2011

Journal Post 4

My code for the color cube, with color this time. There's only about four more lines of code then before. The "ball" and "color" variables are assigned in the for-loops. A color is assigned to each sphere with RGB values corresponding to its x, y, and z position.

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;
}
}
};

Journal Post 3

A couple bits of code I found useful when working on the color cube. I ended up using them a lot, so I decided to write it down here for further reference.

select -all;
delete;
//to select then delete everything

file -import -type "mel" -ra true -namespace "color_cube" -pr -loadReferenceDepth "all" "/Users/Colin/color_cube.mel";

//to import the mel script

Journal Post 2

In class we came up with the code below for the color cube. A sphere is created for every x, y, and z in the three for-loops, producing an 8x8x8 cube made up of spheres.

for ($z = 0; $z < 8; ++$z)
{
for ($y = 0; $y < 8; ++$y)
{
for ($x = 0; $x < 8; ++$x)
{
polySphere -ch on -o on -r .05;
xform -translation ($x/8.0) ($y/8.0) ($z/8.0);
}
}
};

Journal Post 1



I watched a set tutorials on YouTube about MEL scripting. It starts off very simple with creating cubes and talking about different variable types (int, float, string) and eventually gets into loops and shows you how to disperse a bunch of cubes randomly in a 3D area.

Friday, January 28, 2011

Assignment 2: ball bounce



Here is a bouncing tennis ball animation created with Maya and After Affects (instructions on how to texture the ball are not included. I just textured mine to look cool). Here are the steps to replicating the animation:

First, open Maya. Create a ball by clicking the NURBS Sphere button on the shelf under Surfaces (make sure Interactive Creation is off).

With the ball selected, type 10 in for Translate Y in the Channel Box. Then set the keyframe (press S on the keyboard).

Go to frame 10 and set the Translate Y value to 0. press S.

Go to frame 18 and change the Translate Y value to 8. press S.

Repeat this process for each time the ball does a full bounce by decreasing the Translate Y value and the number of frames by 3/4 of the previous value. For example, if it took 8 frames for the ball to bounce up and back down, then the next bounce would take 6 frames to bounce back up down.

When finished, go to Window -> Animation Editors -> Graph Editor. This step requires quite a bit of mouse work, but it's important if you want the bounces to look realistic. Adjust the curves for Translate Y so the ball moves faster as it reaches the floor and slower as it reaches its peak.

Under the Display Render Settings, set the image format to PNG and make sure the Frame Range includes the whole animation. Go to Render -> Batch Render.

When Rendering is complete open After Affects. Press command I to import your images. Select the first PNG file and make sure PNG Sequence is checked. Press Enter. Click and drag the batch of images to the New Composition button. Press command M to put the images in the Render Que. Click on Lossless next to Output Module and click on Format Options. Set the Video Codec to MPEG-4 Video. Press Enter twice to confirm and then press the Render button. This concludes all the steps for making a bouncing ball.

Sunday, January 23, 2011

Post 1: previous work

I originally came into the IFDM program to learn computer animation, but I think what I like best is working with graphics; stuff like texturing, graphic art/design, or matte painting.

Here's some work I did for Saggios restaurant this past summer. These are just still-images, the real thing is a simple flash animation that loops. It has the Three Stooges, the statue of David, the Leaning Tower of Pisa, Charlie Chaplin, and the Coliseum. An interesting combination.