Turtle Graphics - JavaScript/VRML
Activities
- Draw a square by applying forward 100 and left 90 repeatedly.
- Put the pen up, move forward then put the pen down and complete
a second square.
- The picture can be cleared by reload. Try the "squares" button. Guess
what commands are executed before inspecting the source of turtle.htm
to find out.
- Take copies of the files turtle.htm
and turtle.wrl. Adapt the function(s) to achieve
the following:
- Pack in ten squares - rotate only 36 degrees between squares.
- Pack in x squares, where x is specified by the user. Rotate an
appropriate amount between each square.
- Create a new button which activates a new function SawTooth. The
effect should be to draw a "saw tooth wave" with specified amplitude
and wavelength. (Students who have forgotten their trig. may implement
square waves).
- Create a new button to draw a wire frame cube.
Technical notes.