Saturday, January 31, 2009

Scripts - Recap Script

//this script recaps scripts from the previous class and adds the "if...else" statement
//make sure to rename the first object "stage0"


float $rotate_y = 15.2;

int $i = 1;
while ($i < 30){
//refresh the screen
currentTime $i;

//defines my rotation
$rotate_z = $i * 3;

//if statement
if ($i < 15){
$rotate_z = $rotate_z - 2;
} else {
$rotate_z = $rotate_z - (rand(4));
}

//define object names
//by using $objectprevious, the duplicate command in the next section makes sure to duplicate the previous object
string $objectname = ("stage" + $i);
string $objectprevious = ("stage" + ($i - 1));

//other commands
duplicate -rr -n $objectname $objectprevious;
move -r 0 0.18 0 $objectname;
rotate -r -os 0 0 $rotate_z $objectname;

//count
$i = $i + 1;
}

No comments:

Post a Comment