Tuesday, February 15, 2011

Assignment 2 (Again)



We did the color cube again in class, and the code is shorter (and thus prettier). So I felt I should post it here.


for ($x = 0; $x < 8; ++$x){
for ($y = 0; $y <8; ++$y){
for ($z = 0; $z <8; ++$z){
$name = `shadingNode -asShader blinn`;
$tmp = $name+ ".color"; //blinnShader1.color
setAttr $tmp -type double3 ($x/7.0) ($y/7.0) ($z/7.0);
$objName = `polySphere -ch on -o on -r .03`;
xform -translation ($x/8.0) ($y/ 8.0) ($z/ 8.0);
hyperShade -assign $name;

}
}
}



I also don't know how to keep the indents in blogger, so I'm stuck with it all being aligned on the left side.

No comments:

Post a Comment