Homework, plus code from last class.

For homework this week, make a screen drawing in processing, and then convert it to a flexible function that takes any xpos and ypos and draws that item there. See the series of robot sketches we looked at in class for help, but you’ll have to convert hard-coded values for position into variables by doing a little math. For extra credit, make a another variable for size so the size of your drawing can also be altered.

Once you have defined this function, see if you can draw multiples of your drawing using a loop (see the robot loop examples and the albers examples for help here). Finally, try turning on or off some element such as color in your sketch using a boolean (see the triangle sketches for an example).

Email me with questions!

Sample code is here.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>