-
Notifications
You must be signed in to change notification settings - Fork 6
Homework MimiY 03
Questions (example questions)
- Your questions here
- Videos: Images/Video 11.1-11.8 - Focus on videos 11.1 and 11.3
- Chapter 7 in Getting Started with P5.js through Ex 7-9 | Code
- Full Resources
- Week 6 in the Syllabus
- Arrays in JavaScript | Documentation
- 2 balls, 8 variables
- 2 balls, 2 object literals
- Array of Ball() objects
- Complete the Worksheet
- Next week you will be presenting your own assignments. Time limit is 5 minutes. Be prepared to point out 3 things in your sketch and how they're working. (e.g. Here's a loop, it's limit is being set by the mouse. This doohicky is an object and I have an array of 100 of them. They flicker and change color and when I click, I flip a boolean to make them start and stop flickering.)
- 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();
}
}
- Videos 8.1-8.10
- More resources from syllabus
- p5.dom section of Chapter 13.4-13.6 in Getting Started with P5.js
Questions (example questions)
- Your question here.
- Your Name -- [Title of Blog Post](Link to Blog Post), [Title of Sketch](Link to Sketch) -- any other comments
- Samuel Sords -- coin face observing the abstract
- Ben Moll -- Creating Frogger.js,frogger
- Sydney -- drawing tool
- Emily -- Drink Conveyor Belt, Blog
- Nok -- dots
- Benben -- duck hero
- Gil -- click for butterflies
- Sarah -- [Feed Pizza Rat] (https://editor.p5js.org/sarahliriano/sketches/OqmtKCmwd)
- Sheng -- Don't forget your umbrella
- Tina -- Blow Some Kisses, Blog Week 06
- Pablo -- the most frustrating eraser tool
- Rachel -- Biscuit Time
- Filmon -- Day&Night
- Shannel -- The Piggy Bank Game
- Mingxi -- Drum + Serial
-
RESOURCES FROM CLASS:
-
TEST YOURSELF
- Complete the Quiz
-
DO: 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, however, choose to try a new experiment from scratch. Aim to keep
setup()
anddraw()
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. | How to do this.
- Break code out of
setup()
anddraw()
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.
-
READ / WATCH
- Videos 2.3, 6.1-6.3, 7.1-7.7
- More resources and code examples
- Getting Started with p5.js chapters 10-11
-
Examples
Questions (example questions)
- Your question here
- Your Name -- [Title of Blog Post](Link to Blog Post), [Title of Sketch](Link to Sketch) -- any other comments
- Samuel Sords -- coin face observing the abstract
- Filmon Abraham -- Waterfall w/ functions
- Tina - Fish in Waves with Functions, Interactive Self Portrait with Functions
- Emily -- Plaid with Functions
- Sydney -- sunrise slider with functions
- Ben -- Redrawing Rick,Rick with Objects
- Nok -- Moon
- Shannel -- eye re-draw
- Sarah -- [Blog: Patterns and Functions] (https://sal5014.wixsite.com/itpblogs/post/icm-week-5-patterns-and-functions)
- Benben -- pink wave
- Gil -- organized face
- Rachel -- pizza time
- Pablo --bouncing snake
- Mingxi --Drums
- Sheng --bouncing
-
RESOURCES FROM CLASS:
-
TEST YOURSELF: Complete Worksheet 4
-
DO: Make something with a lot of repetition, more than you want to hand-code. You could take something you've already done where there was a lot of repetition in the code and see if you can re-write it using a loop so that instead of 28 lines of code that call rect(), you have 1 line of code calls rect() inside of a loop that goes around 28 times. How do you need to rework the way you position that rect() in order to make it work in a loop? Try creating an algorithmic design with simple parameters. (One example is 10PRINT, example code).
-
READ / WATCH
- Videos 5.1-5.3 in the learning p5.js series.
- Getting Started with p5.js chapters 9-10
-
RUN CODE
Questions (example questions)
- Your questions here.
- My checkerboard code works only when rows is less than 10 and I can't figure out why? -Ben
- Your Name -- [Title of Blog Post](Link to Blog Post), [Title of Sketch](Link to Sketch) -- any other comments
- Mingxi -- Car Race
- sydney -- 10PRINT style algorithmic design
- Ben -- Raving Circles,click for a rave
- Nok -- 15 x 15
- Shannel -- Eyes
- Benben -- MICROCOSMOS
- Rachel -- Geometric Patterns pw: itpnyu
- Gil -- scanning pixelator
- Tina -- Fish in Waves, Blog Week 04
- Emiy -- Plaid
- Pablo -- Just Another Funky Tuesday Night
- Sheng -- mood for icm
- Sarah -- [loops and repetition] (https://sal5014.wixsite.com/itpblogs/post/week-4-icm-loops-and-repetition)
- Filmon — Waterfall **
-
RESOURCES FROM CLASS:
-
TEST YOURSELF: Complete Worksheet 3
-
DO: In general this week, you should work with rule-based animation, 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 off 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 compares 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.
-
READ / WATCH
- Videos 4.1-4.2 in the learning p5.js series. | Code
- Chapter 4.5-4.13 of Getting Started with p5.js book | Ebook (free with NYU Library login) | Code
Questions (example questions)
- Your questions here.
- Can you make p5 sketches shareable and editable between 2 people? Can you define the Input/Output of the assignment? - Pippa
- Your Name -- [Title of Blog Post](Link to Blog Post), [Title of Sketch](Link to Sketch) -- any other comments
- Nok, Mingxi -- The bird
- Ben, Sarah -- Partner Programming with Sarah Liriano,"Press me!"
- Tina, Sean -- Tina's Blog Week 03, Browser PONG
- Benben, Gil -- Benben‘s blog, Gil's blog, ellipses
- Sydney, Rachel -- week 3, sunrise slider
- Shannel, Sammy -- Joker's Labyrinth
- Emily, Filmon -- Into the Spiderverse
- Sarah, Ben -- [Blog Post] (https://sal5014.wixsite.com/itpblogs/post/variables)
-
LINKS FROM CLASS:
-
TEST YOURSELF: Worksheet Post a url to your answers on the Google Doc.
-
DO: 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.
- e.g. 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.
- e.g. Do the above but change color, alpha, and/or strokeWeight instead of position.
- Or do something completely different!
-
WATCH, READ, RUN CODE:
Questions (example questions)
- Emily -- Can you group multiple shapes together?
- Sydney -- Is it possible to use noLoop() on a single shape? If not, how does a specific shape inherit a random color without flashing all the different color options?
- Gil - When applying random to colors, it seems like the same colors repeat themselves. Are there better ways to generate randomality?
- Shannel - How to apply one function to multiple elements together?
- Pablo - Is it possible to use different frame rates for different shapes?
- Boaty McBoatface -- blog post, zoog -- any other comments
- Samuel Sords -- ghost face
- sydney meyers -- blog post, pixel portrait week 2
- Ben Moll -- week 2 blog(week 2 sketch)
- Nok Jangkamolkulchai -- blog post, week 2 portrait
- Mingxi Xu - illust
- Gil Sperling blog post, animated portrait
- Tina Rungsawang - blog post, week 2 portrait
- Shannel Doshi - blog post, portrait week 2
- Benben Fan -- blog,portrait
- Zhoujian Sheng - sketch
- Pablo Mahave Disco Mickey
- Rachel Costas - blog, portrait-- password to blog is itpnyu
- Filmon Abraham - sketch
- Emily Zhao - blog, sketch
- Sarah Liriano - https://sal5014.wixsite.com/itpblogs/post/icm-week-2
-
RESOURCES FROM CLASS:
-
SET UP:
- 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.
-
DO:
- Complete this worksheet. Our weekly worksheet become the basis for the next class. You must be logged in with your NYU account to access the worksheet.
- 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's a sample example: Zoog - 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 (or a new one), 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?
-
READ AND WATCH:
-
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.
-
Watch before homework: Videos 1 - 7 | Watch after homework: Videos 2.1 - 2.3
-
ASK QUESTIONS: Contribute at least 1 question below.
Questions | Examples
- your question, your name
- How to delete a stroke for only one shape, without deleting for the whole image,Benben Fan
- How to click and place points rather than guessing coordinates - Ben Moll
- How to add smaller increments to points rather than whole numbers to be exact with coordinates? - Shannel
- Would splice() function for the array be different from pop() function? - Mingxi
- Is there a good website to upload photos so that I could fetch them freely without asking for permission and other barriers - Mingxi
- In the rect() function, the first two parameters determines the left-upper corner position. Can we change the left-upper corner to the center of the rectangle? - Mingxi
- The code runs even without internet connection; which parts of p5.js are local to the computer and which are online? - Gil
- It seems to run into performance issues pretty quickly, is that the fate of using a browser-based program? Can it be tweaked? - Gil
- Is there a way to move or rotate a group of items collectively without displacing their placements in relation to each other? - Tina
- How do you use mouseX/mouseY on drawings with multiple coordinate points (like a shapes made with quad or bezier curves)? - Tina
- Is it possible to view the canvas with a grid like you can on the adobe programs? - Sydney
- Is it possible to tilt an ellipse() function using a base point other than the gravitational center? - Pablo
- Is there a way to merge two shapes into a single solid that can then be colored in? - Pablo
- How do you comment out sections/selections of code? - Emily
- Is there a hotkey/shortcut for the "play" button? - Rachel
- How do you go about making breakpoints so the design is responsive on mobile? - Rachel
- How do you make a symmetrical image without doing all the math?
- Boaty McBoatface -- [blog post](url to blog), zoog -- any other comments
- Benben Fan -- Week 1 blog,Sketch
- Nok Jangkamolkulchai -- Week 1 blog,self-portrait
- Ben Moll -- [Week 1 Blog] (https://wp.nyu.edu/benjaminmoll/category/fall-2019/comp-media/), [Rick Sanchez] (https://editor.p5js.org/benjamin-moll/sketches/1Vlc1rTpz)
- Shannel Doshi -- [Week 1 Blog] (https://wp.nyu.edu/shanneldoshi/category/intro-to-computational-media/), [Dairo - p5js avatar] (https://editor.p5js.org/Shanneldoshi-NYU/sketches/yfCNLCxtA)
- Mingxi Xu -- Blog Post, Franka
- Sydney Meyers -- blog post, pixel portrait
- Gil Sperling -- [blog post pt1] (http://www.gilsperling.com/why-computation/), [blog post pt2] (http://www.gilsperling.com/self-portrait-assignment/), self portrait?
- Tina Rungsawang -- Week 1 Blog pt1, Week 1 Blog pt2, Self Portrait
- Pablo Mahave -- Blog Post Week 01, p5 Mickey Mouse
- Emily Zhao -- blog post, self-portrait
- Rachel Costas -- blog post, my portrait -- password to blog is itpnyu
- Filmon Abraham -- [Blog Post] (https://filmon.myportfolio.com/blog), [MOOO!] (https://editor.p5js.org/filmonabraham/sketches/Yvhj8iTWS)
- Sheng Zhoujian sketch
- Sarah Liriano [Blog Post] (https://sal5014.wixsite.com/itpblogs/post/icm-week-1-drawing-with-code)
- Samuel Sords -- self portrait