Saint Louis University |
Computer Science 1300/5001
|
Computer Science Department |
Mickey
One of the drawings in our previous activity was drawing the following
image of Mickey Mouse on a 500 x 500 canvas.
This time, we wish for you to create that same drawing, but
proportionally based upon a variable w that represents
the width of the canvas. So if w=500 it should look like the
above image, but if w=200 it should appear as follows.
Spoiler: my code
Ice Cream Cone
Write a script that draws this ice cream cone, but designed in a way
so that it uses a variable w that defines the width of
the canvas. Here are images of our cone drawn with w=200 and
w=400.
As an aside, the scoop is a full circle, and if you look carefully, a
tiny bit of it is visible aside the cone (dripping, I presume).
Spoiler: my code
Propeller
The blades of the propeller are ellipses having width 35 and height
200, prior to being rotated about their centers.
Spoiler: my code
Rotated Rectangle
The bigger rectangle in the following is 100 x 400, with one
of its corners coincidentally positioned at coordinates
Spoiler: my code
Stick Figure (à la xkcd)
Create a layer containing all parts of this stick figure. If
successful, you should be able to then add it to a large canvas
and do something like
person.move(20,0) sleep(0.5) person.move(20,0) sleep(0.5)
Pine Trees
Create a pine tree as a layer, so that the bottom of the trunk is
placed at the origin of the layer, as shown in the following model.
Once you've built that layer properly, you should be able to create a
large canvas, add the tree to the canvas, and then create clones of
the tree which can be scaled to other sides. The key is that if the
base of the trunk is at the origin, then when scaled, all trees will
"grow" upward.
Spoiler: my code