CPSC 120: Project 3

Due by 11:59 pm on Friday, 05/05/2017

Home | Calendar | Announcements | Assignments | Example Code | Notes

Emergent, Generative Art

For your last work of this semester, you are to complete a work of emergent, generative art, drawing on the techniques we've learned for managing entities through arrays and for defining those entities as objects. It also draws heavily on Chapter 6 of Pearson's book. Exactly what you build and how you do it is up to you. However, there are a few minimum requirements for you to meet.

Minimum Requirements

  1. Your work must interact in some way with the mouse, clicks, drags, and or movement.

  2. The work must involve the display of several moving entities, enough that you need an array to manage them all.

    You should do this with one array, which stores objects of your "entity" type (see below), rather than a set of arrays that you process in parallel (which is what you did for Project #2).

  3. The "entity" (call it whatever you want) must defined in a separate class. Exactly what you do with this class definition is again up to you, but your design should include at least the following methods, for initialization of objects, displaying them, and drawing them. You may define these methods independent of the class definition itself, or you may include them in the class for a bit of extra credit (we'll see how to do this on Monday, 05/01, and it is also documented in Pearson, Chapter 6)

  4. Your work should utilize some form of rotational drawing. How you do that is up to you. It can be in the movement of entities on the screen, in their display, or something else.
  5. Your work should utilize some form of either randomness or Perlin noise. Again, how you incorporate that is up to you.
  6. Your work should organize significant pieces of code into methods that you define. Definitions of setup(), draw(), keyPressed(), mousePressed(), and other, built-in event handlers are fine (and probably necessary), but they don't count here. You have to define and make use of your own.

    Points will be added or deducted, depending on how well you use this kind of abstraction to structure your program. That's a subjective measure, of course, but some guidelines apply almost everywhere:

    1. Repeated tasks should be moved into a single method definition, which is called in every place where the task eneds to be performed.
    2. Tasks that really on specific value assumptions (e.g. literal integer or color values) should become methods with parameters, which are called with the specific values passed as arguments.

Other Criteria

  1. Your work will be assessed in part on the elegance and clarity of your code, that is, the clarity an simplicity with which you accomplish complicated tasks. This is a somewhat subjective criterion, but it mainly boils down to the idea that there should be exactly as much code as you need to get a job done, neither more nor less, and what's there should be comprehensible to an independent reader.

    As a partial (but not complete list):

    1. Indentation must be proper. This will be assessed from the paper printout you turn in, so do not assume that your grader will simply fix this for you.
    2. Variables should almost always be used instead of hard-coded values, but the scope of a variable should be neither more nor less than what is needed (e.g. only make a variable global if there's no other choice).
    3. Loops should be used instead of repeating a related series of operations one at a time.
    4. Per the above requirement to use method abstractions, tasks that are repeated should be defined as methods that are called, rather than copying and pasting the same text over and over.

  2. Work whose visual presentation reflects a particularly thoughtful attention to grace, detail, and coherence of presentation will count favorably.

  3. Each file you submit must have a "header" comment of the following form:

       <file name> ( < n > of < number of files > )
       Author: <your name>
       CPSC 120 (Spring 2017), Project 3
  4. Extra credit may be given for the incorporation of ideas you learn on your own that we have not covered in this class. Examples include recursion, manipulation of PImage values, L-systems, etc. For any such "extra", you should document clearly what idea you have learned and give a clear citation of your source (even if it is page numbers in later chapters of our textbook).

Getting Started

This project is a lot easier once you've read Chapter 6 (for the class definitions and emergent behavior). However, you can make significant progress right away. Here are some broad ideas that might help.

Class definitions

Study the example code that was posted on April 24th. This should give you a working template for your own ideas.

Emergent Behavior Rules

This is really just building an update method that checks all of the neighboring entities and uses their location (or color, or size, etc.) to update the components of this entity. For a template example, look at listings 6.4, 6.5, and 6.6 of Pearson's book (though it's best to start from 6.1, 6.2, and 6.3, in order to understand how he gets there).

You can get copies of all of the source code from this book at the book's web site, http://zenbullets.com/book.php. Indeed, Chapter 6 is also available there, as one of the samples!

The array of entity objects in your sketch will need to be globally visible, in order to be updated in the draw() method. To have it also be visible in the update method of your entity class, you have two choices:

More Ideas

The term "generative art" encompasses more than just interactive visuals constructed by computer programs, though this has become the dominant tool for making such works. Here's a general overview: http://en.wikipedia.org/wiki/Generative_art.

Generative.net (http://generative.net) has a good collection of links to various works

In addition to http://zenbullets.com, Pearson keeps a second gallery at http://abandonedart.org. It's a bit of a time sink, as many of the works are quite mesmerizing.

There is a particularly beautiful work called "Silk", which you'll find at http://weavesilk.com

Turn In:

Submit the folder containing your Processing sketch. This should be a single folder named "project3", which will contain all source code files. Again, the turnin directory is


PLEASE NOTE: Unlike other assignments this semester, you must turn in your own printout of your work, as this best reflects your attention to the presentation of your own work. I will test the electronic submission you make, but I'll only read the paper printout you give me. They should match exactly, of course. Please deliver these either to my mailbox (the Science office, in Eaton Hall) or to my office at Lansing 300.

John H. E. Lasseter