Excerpeted from http://stage.itp.tsoa.nyu.edu/nature/ Daniel Schiffman’s Nature of Code Class for Spring of 2005
PART I: Motion
Class Overview
Processing review
Object Oriented Programming review
Vectors — motion basics (velocity / acceleration).
Assignment
- Sign up for the class mailing list.
- Sign up for a presentation slot.
- Read through the source code from the above examples and examine the object oriented structure and syntax. Where are the class definitions? Where are the object instances declared? When does the constructor get called and what arguments are required? Write down and bring to class any questions related to OOP.
- Get up and running with the new version of processing (instructions on class e-mail list). Run one of the above examples and post it online as an applet
- Optional: Develop your own Processing example based on this week’s material.
- (Choose one or more of the following…or create your own.) Extend one of the examples into 3 dimensions.
- Apply the concepts of velocity and acceleration to something other than the usual 2D motion. (what else changes in a digital world — rotation, color, etc.)
- Using a single primitive shape only (square, ellipse, etc.), create a "personality" for your object by affecting its velocity & acceleration. Can you make it appear to be "alive" and/or have intelligence?
- Extend one of the above examples to include multiple objects using an array or ArrayList. Can these objects interact with each other somehow?
Week 2 — Jan 26
Forces
Attraction/Repulsion, Friction/Drag
Assignment
- If you haven’t already, sign up for the class mailing list.
- If you haven’t already, sign up for a presentation slot.
- Develop your own Processing example based on this week’s material.
- (Choose one or more of the following…or create your own.) Extend one of the examples into 3 dimensions.
- Examine the first example which implements a "drag" force. Can you make a liquid class (moving the code out of the main program)? Can you create a system of multiple objects moving through multiple "liquids"? (click here for an example of one solution.)
- Can the concept of "force" be used as a metaphor for some other situation? What other forces are there in the digital worlds you create?
- Research and implement another type of force not covered above.
- Can you use the notion of gravity to create a "repulsive" force, rather than "attractive"? Taking the last example above, can you develop some tricks to keep the system stable enough stay within the realm of the window?
Probability Basics
Distributions of Random Numbers (Uniform, Non-Uniform, Normal)
Perlin Noise
Assignment
(Choose one or more of the following…or create your own.)
- Create a visual system that is built entirely by random numbers (random shapes, random locations, random sizes, random colors, etc.). Then, using the concepts outlined above, recreate this same system without any purely random input. Can you design some new methods for "controlled" randomness?
- Take one of your previous assignments involving forces and vectors. Add elements of probability and Perlin noise to your system.
- Use object oriented programming to create a "random walker", i.e. an object that moves around the window randomly (see below for an example). Use the techniques above to move the walker around the screen in a more interesting way. Can you expand the walker to have more advanced physics (the example below it only moves one pixel at at time)?
Trigonometry
Oscillations, Pendulum
Graphing waves (perlin noise waves)
2D trig equation graphing ("graphing inequalities")
Assignment
- Develop an idea for a two week assignment. Divide the work for this assignment into two parts. For next week, post your progress with part I (as well as a written description, a few sentences is ok). Everyone will present their progress through "part II" on Feb 23rd.
- For example: Using the techniques we’ve seen up until now (velocity, acceleration, random number generation, oscillation) design a virtual creature that moves according to various rules. For part II, extend that single creature into a particle system of many creatures.
- Take one of the existing systems we’ve looked at (gravitational bodies, sine wave, etc.) and leaving the algorithm intact, develop an entirely new way of visualizing the system. In other words, change only the drawing code.
- Combine linear motion with oscillation, i.e. consider a point with velocity and acceleration that moves about a space. Make that moving point the center of origin for an oscillating body
Advanced Object Oriented Programming — Inheritance and Polymorphism
Week 6-
Review
PART II: Life
Recursion and Fractals
1D Cellular Automata — Wolfram
2D Cellular Automata — Conway’s Game of Life
Assignment
- Develop your own recursive system to generate complex, fractal-like shapes. What are the parameters of your system? Can you make the recursive drawing an object with instance variables associated with those parameters?
- Read through the chapter 6 discussion of L-Systems. Can you develop code that generates strings from an Axiom and Ruleset? (Step 2 is to draw to the screen based on the generated Strings, but feel free to stick with just the text for now).
- Redo the Game of Life example with object oriented programming. Create a class for each individual cell as well as one for the whole system itself.
- What types of systems can you model with Cellular Automata? Consider allowing cells to have more than 2 states and develop your own rules for changing states.
- Examine the Predator/Prey System described on p. 191 of Computational Beauty of Nature. Can you use the principle of cellular automata to model and visualize it?
- Consider the state of a cell to be its color. What types of image processing filters can you create using the principles of Cellular Automata?
Steering
Craig Reynolds’ Boids — Alignment, Cohesion, Separation
Want your say?