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); } } };
No comments:
Post a Comment