Saint Louis University |
Computer Science 1300
|
Computer Science Department |
Please make sure you adhere to the policies on academic integrity.
This homework is a bit more challenging than the past homeworks, but it seems like it would be good to have you practice these techniques with more time available, prior to our hands-on day.
On a recent quiz (solutions here), you were asked to create the following image
however you were allowed to hardcode the geometry for this
500 x 300 canvas.
For this problem, we wish to have you recreate such a script, but with the entire drawing created proportionally based upon a variable w that represents the width of the screen. You need not concern yourself with the canvas title or background. We are only interested in the geometry.
When w=500 your script should produce the same
picture as above, but if for example w=1000, the
following should result.
Write a new script for the 500 x 300 version of the above script (you are welcome to hardcode the geometry this time). In this new script, you are to create a layer that contains both the body and head of the animal, placed so that the center of the body rectangle is at the origin of the layer.
Then place the layer on the canvas and move it to the position
matching the original image, and then rotate it by -30
degrees. The result should appear as follows