EARTH 801
Computation and Visualization in the Earth Sciences

Lesson 3: Summary and Exercises

PrintPrint

Now you can expertly move a shape you drew around your screen at different speeds! Cool!

Exercises:

3.1 Write a program that moves a custom shape around the screen (your choice about what path it follows: straight line or some other function). It should stay on the screen and change direction if it encounters any of the sides of the display window.

3.2 Modify your program from Exercise 3.1 so that the shape also changes color if it hits any of the sides of the display window

Turning in your work:

Submit Exercise 3.2 to its appropriate assignment in the Lesson 3 module in Canvas. Name your file lastname3_2.pde

What I'm looking for:

Your program should demonstrate correct usage of an if statement to change the direction and fill and/or stroke color of your shape. Your shape should be a custom shape drawn using beginShape() and endShape(). Extra creativity such as using a for loop to set the vertices, or creating a composition with more than one shape is encouraged!

Reminder - Complete all of the Lesson 3 tasks!

You have reached the end of Lesson 3! Double-check the to-do list on the Lesson 3 Overview page to make sure you have completed all of the activities listed there before you begin Lesson 4.

You should have been participating in the teaching/learning discussion and you should have submitted Exercise 3.2 to the Lesson 3 dropbox.