
That unit introduces the transformation functions for rotating and scaling. It also explains how to combine the functions to control the effect. As a first exercise I used rotate() to change the orientation of a shape. The second exercise I used scale() with a for structure to scale a shape multiple times. And the third exercise combined translate() and rotate() to rotate a shape around its own center.
This unit introduces programs that run continuously and explain how to control their speed. The first exercise was to make a program run at four frames per second and display the current frame count to the console with println. Well that was interesting to do. But the output of the program was not interesting enough to show it here. The second exercise is a little bit more interesting. Move a shape from left to right across the screen. When it moves off the right edge, return it to the left. You can downloade the code and see the animations here:
Exercise_20_02_01
Exercise_20_02_02
Exercise_20_02_03
Exercise_20_02_04
Exercise_20_02_01 and Exercise_20_02_04 are running with a shocking 5 frames per second. The third exercise I did not do because I thought it was already integrated into the second exercise.
This unit introduced basic concepts and syntax for writing functions. The first exercise was to write a function to draw a shape to the screen multiple times, each at a different position. The second exercise was to extend the function created for exercise 1 by creating more parameters to control additional aspects of its form. The last exercise was to write a function to use with a for structure to create a pattern evoking a liquid substance. I don’t think that I succeed in that for a hundred percent. But maybe a fifty. I will try it again later. You can take a look at the animations and download the code here:
Exercise_21_03_01
Exercise_21_03_02
Exercise_21_03_03
Exercise_21_03_04
Exercise_21_03_05
Strange enough only Exercise_21_03_01, Exercise_21_03_02 and Exercise_21_03_05 seem to work in the browser. But when you download the code and run it in the Processing PDE it will work fine.
Next page