- Day 1: Graphics, variables and functions
- Day 2: Parameters, returns and conditionals
- Day 3: Objects, arrays and vectors
- Day 4: Polylines and classes
- Day 5: Review
TODO: motivation behind each exercise (pre and post conditions / pre reqs and outcomes) TODO: asteroid -> astroid TODO: "turn to student next to you" moments
-
Create and run openFrameworks projects
-
Introduce basic C++ syntax
-
Use openFrameworks graphics functions (
ofDrawLine
,ofDrawCircle
etc.) in thedraw
loop -
Understand the painter's algorithm
-
Declare and assign primitive variables (
int
,float
) -
Use variables to reduce redundancy
-
Declare and define functions
-
Generalize a function with parameters
-
ADD: introduce cout here earlier
-
ADD: strings?
-
Use
cout
to log values -
Use
ofRandom
to produce random numbers in various ranges -
Draw shapes with different colors; understand how
ofSetColor
fits into painter's algorithm -
Put variables in
ofApp.h
that persist over the lifetime of the program -
Use the openFrameworks
setup
function to initialize variables -
If statements
-
ADD: While loops here
-
For loops
-
Nested for loops (MOVE TO DAY 3?)
-
Use the
sin
function for animation -
Write functions that return values
-
Understand state updates of the form
x = transform(x)
-
ADD: Celsius / Fahrenheit example
-
ADD: another example?
-
ADD: Boolean types and logic
-
ADD: More if statements and for loops
-
ADD: introduce while loops here
-
ADD: more for loop drawing problems
-
Review variables
- Life cycle of variable
- Variable types
- Variables in functions vs. variables in
.h
file
-
Review functions
- What is a function?
- Parameters
- Return values
- CHANGE: move function example from day 3 to day 2?
-
Introduce C++ objects as containers for groups of variables
-
While loops (CHANGE: move to day 2)
-
Arrays
-
Vectors
-
average temperature
-
average position w polyline
- Use Polylines to draw shapes
- How to share openFrameworks apps
- Using the openFrameworks
update
function - Basic intro to C++ classes (member variables, functions)
- Transformations
- Using pushMatrix / popMatrix to remember transformation state
- 3D graphics
- Basic Lighting in openFrameworks
- Nested transformations
- Perlin noise
- Keyboard input
- Using openFrameworks addons