Hands-on Activity: Smiley Face

Have a nice day

Your goal is to create the above sketch, but to do so in a scale invariant manner. At the very beginning of your sketch, we wish for you to define two independent parameters:

int canvasSize = 400;   // adjust as you wish
float scale = 0.7;   // face diameter 70% of canvas
If done properly, when chaning the canvas size, everything else (including the text) should scale appropiately. Separately, the percentage of the canvas that is used to draw the face should be controlled by setting the scale variable. For a very polished implementation, note that the font size and the stroke weight for the mouth should be scaled appropriately.


Examples:

canvasSize = 400;
scale = 0.7;
canvasSize = 400;
scale = 0.5;
canvasSize = 200;
scale = 0.5;
size 400, scale 0.7 size 400, scale 0.5 size 200, scale 0.5

SPOILER:

my solution


Last modified: Tuesday, 20 January 2015