Lesson goal: Draw with cubes
Previous: 3D graphics and the light source
| Next: Drawing lines in 3D
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
and such to draw
lots of cubes; they don't have to be placed one at a time. See example #4.
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:
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.