-
Notifications
You must be signed in to change notification settings - Fork 6
Homework MimiO
A big part of learning at ITP is learning from each other. So share your work and in exchange you'll get to see everyone else's!
- Do the assignment.
- Contribute a question.
- Use the homework to post documentation in the form of a blog post. Ideally something visual, some written thoughts, and code. If you are struggling with your sketch and can't get things to work, you should feel free to put your energy into writing about what didn't work (and vent any frustrations!).
I save all of my in-class p5js examples in the web editor. You can see a full list here. It also contains other examples that relate to each week's assignment and that you can consult for additional support if you like.
Assignments are due the night before class each week. I will not give credit for assignments that are turned in late. Keeping in mind that I want you to succeed, and that the material can sometimes be challenging, I absolutely prefer tentative work to work that is turned in late.
Use this form to turn in your homework assignments.
The spreadsheet with everyone's responses is here.
If you find yourself struggling, remember that you have many forms of support that you can take advantage of at ITP. Sign up for the ITP ICM Google Group, look out for the office hours and help sessions that the residents offer. You can find my office hours here and my email is cgo221@nyu.edu.
- Sign up for the ITP ICM Google Group
- Sign up for a Github Account. You need it to edit this wiki page.
- Log into a p5.js web editor account with your github account.
- Class 1 Notes
- History of Programming Languages
- Influence Map of Programing Languages
- Popular Languages Today
- Introduction to the p5 Editor
- Create your own screen drawing: self-portrait, alien, monster, etc. Use 2D primitive shapes –
arc()
,curve()
,ellipse()
,line()
,point()
,quad()
,rect()
,triangle()
– and basic color functions –background()
,colorMode()
,fill()
,noFill()
,noStroke()
,stroke()
. Remember to usecreateCanvas()
to specify the dimensions of your window and wrap all of your code inside asetup()
function. Here are some sample examples: Zoog, Mondrian - Write a blog post about how computation applies to your interests. This could be a subject you've studied, a job you've worked, a personal hobby, or a cause you care about. What projects do you imagine making this term? What projects do you love? (Review and contribute to the ICM Inspiration Wiki page). In the same post, document the process of creating your sketch. What pitfalls did you run into? What could you not figure out how to do? How was the experience of using the web editor? Did you post any issues to github?
-
Watch before homework: Videos 1 - 7 | Watch after homework: Videos 2.1 - 2.3
- If YouTube bothers you, ask Daniel Shiffman for a link to videos on Google Drive.
- If you prefer books, Chapters 1-3 of Getting Started with p5.js cover the same material. Log into the NYU network to read it for free.
Create a sketch that includes (all of these):
- One element controlled by the mouse.
- One element that changes over time, independently of the mouse.
- One element that is different every time you run the sketch.
For example:
- You could try refactoring your Week 1 HW by removing all the hard-coded numbers except for createCanvas(). Have some of the elements follow the mouse. Have some move independently. Have some move at random.
- Or you could do the above but change color, alpha, and/or strokeWeight instead of position.
- Or do something completely different!
Video:
- Conditionals 3.1 - 3.4 | Get Code Here
Example code:
- Video Examples: 3.1-3.4
- Getting Started with p5 Examples: 04, 05, 06, 08.
- Learning Processing Examples: chp03-06
- Animation examples from ICM 2015
Getting Started with p5.js:
- Read Chapters 5 (Response).
- If you're interested in rotation and translation, read Chapter 6 on Translate, Rotate and Scale. This is optional!
Week 3 curriculum outline with links to tutorials, videos and examples. Mimi's examples in week 3 on p5
In general this week, you should work with rule-based animation (with conditionals), motion, and interaction. You can use the ideas below or invent your own assignment. Start by working in pairs as below. Can you divide an idea into two parts and combine those parts? (e.g. One of you codes the input behaviors and the other one codes the output behaviors.) Can you swap sketches and riff of of your partner's work? You can post together or break off and complete the assignment individually.
- Try making a rollover, button, or slider from scratch. Compare your code to the examples on github. Later we'll look at how this compare to interface elements we'll get for free from the browser.
- Tie the above two together and have an interface element control the visual design or behavior of other elements in your sketch.
- OR
- Make an algorithmic drawing. (One example is 10 PRINT, see also: my version of 10PRINT example). Make your interface element control the appearance or behavior of the algorithmic design.
- When working in teams, both partners must contribute. I recommend pair programming, just like we have done in class. Sit next to each other at one keyboard and take turns coding while looking over each other's shoulder.
Loops 4.1 - 4.2
-
Videos 5.1–5.3 in the learning p5.js series.
-
Chapter 4.5-4.13 of Getting Started with p5.js book | Ebook (free with NYU Library login) | Code
-
Chapter 4.5-4.13 of Getting Started with p5.js book | Ebook (free with NYU Library login) | Code
Note 1: If you want to learn how to use p5.js out of the browser (aka what I was doing at the end of class), watch this video. This is not mandatory, do not worry about it if it seems confusing.
Note 2: This is the week where things begin to get complicated, and concepts start to build up on each other. Try to use things you've learned from the previous weeks: use variables wherever you can, when you want interaction and animation think in terms of incrementation (x++, x+=, x*=), and remember that conditionals are powerful because they allow us to perform different computations or actions depending on whether a condition evaluates to true or false.
Week 4 curriculum outline with links to tutorials, videos and examples. Mimi's examples for week 4 in p5 editor
This week, your assignment is straightforward: make something with lots of repetition (more than you would want to hand-code), and use one or more for loops to make it simpler. For instance: you could take something you've already written where there was a lot of repetition in the code and re-write it using a loop so that instead of 28 lines of code that call rect(), you have 1 line of code calling rect() inside of a loop that goes around 28 times. Or you could make something new that involves lots and lots of lines but draw them in different places with a for loop. The truth is that writing code is just logic-basd creativity, and this week is about feeding that. So focus more on rethinking HOW you write code than on writing lots of code or creating the coolest sketch.
- Videos 5.1-5.3 in the learning p5.js series.
- Getting Started with p5.js chapters 9-10
The idea this week is to explore re-organizing your code. It is 100% legitimate to turn in a version of a previous assignment where nothing changes for the end user, but the code has been restructured. You may choose to reorganize someone else's code——though you might want to make sure they're okay with it first ;) You may, however, choose to try a new experiment from scratch. Aim to keep setup() and draw() as clean as possible, and do everything (all calculations, drawing, etc.) in functions that you create yourself. Possibilities (choose one or more):
- Reorganize "groups of variables" into objects.
- Break code out of setup() and draw() into functions.
- Use a function to draw a complex design multiple times with different arguments.
- If you are feeling ambitious, try embedding a function into an object.
- Videos 6.1-6.3, 7.1-7.7
- More resources and code examples
- Getting Started with p5.js chapters 10-11
- Week 4 Examples
- New object syntax
- Video Examples for Objects and Arrays
- Getting Started with p5.js Chapters 10-11
- Learning Processing examples Chapters 8-9
Design a sketch in an object-oriented fashion. Follow these steps and see how far you get (even just doing the first couple steps is ok!)
- Make one single object with just variables.
- Put one or more functions in the object.
- Try manually making two objects.
- Duplicate the object using an array and make as many as you like! If you are already working with classes/objects and arrays:
- Re-organize / break-down your classes into the "smallest functional units" possible.
- Try different ways to have your objects "communicate" with each other in some way. In the end the goal is to have code in draw() that only makes calls to objects. Something like:
function draw() {
background(0);
// A single object
apple.chop();
// Another object
orange.peel();
// Calling a function on all of the objects in an array
for (var i = 0; i < grapes.length; i++) {
grapes[i].pluck();
}
}
p5.dom section of Chapter 13.4-13.6 in Getting Started with P5.js Video Examples Getting Started with p5.js Chapters 13_05 + 13_06
Next week will be your final week of class with me! We'll have a brief lesson, you'll get a chance to present your work, and then we will wrap up your half semester of ICM Code and prepare you to move on to ICM: Media!
Prepare yourselves for ICM Media by watching the first 2 video tutorials listed on this page under the heading Basics. You may also receive more instructions from Lisa.