In a previous lesson, you did some drawing with spheres. You
can also draw here with cubes (sort of like Minecraft...we guess).
Also, remember, you are coding now. You can use for-loops and such to draw
lots of cubes; they don't have to be placed one at a time. See example #4.
cube(x,y,z,width,height,depth,"color")
Move the mouse over a dotted box for more information.
You can find a list of color codes here.
The 3D drawing area will appear under your code-editor. You might have to scroll down to see it.
Now you try. Fill in a x,y,z and width, length, and height of your cube.
Type your code here:
See your results here:
This code will not run!
Fill in $(x,y,z)$ coordinates of the cube, then a width, length, and height. To start out, keep all numbers between 0 and 10 or so.
Also, your cube might just look like a square (as you are looking at it head-on). To see the cube, you'll have to move the camera and/or light source around a little bit.
Share your code
Show a friend, family member, or teacher what you've done!