-
Notifications
You must be signed in to change notification settings - Fork 0
Homework Dave 03
-
Notes from Class:
-
RESOURCES FROM CLASS:
-
TEST YOURSELF
- Complete the Worksheet
-
DO: Functions are the basic unit of labor in your code. Take a sketch you’ve already done and re-organize the code into functional units of labor that you define. You can also conceive of an entirely new world of labor. What kinds of labor does it take to make your sketch run?
- Take time to name your functions well. In class we will comment out function calls one at a time and see if we can predict what will stop working.
- Aim to keep
setup()anddraw()as clean as possible, and do everything (calculations, drawing, etc.) in functions that you define. - Challenge goal: Write a re-usable function, a function you can call in multiple ways to do the same thing slightly differently each time.
-
READ / WATCH
- Video 2.3 on JavaScript Object Literals (~10m)
- Videos 6.1-6.3, 7.1-7.7(~2h)
- More resources and code examples
- Getting Started with p5.js chapters 10-11
-
Examples
-
ASK
- Post at least 1 question here. Need help on asking a question?
- Your Name -- [Title of Blog Post](Link to Blog Post), [Title of Sketch](Link to Sketch) -- any other
-
NOTES FROM CLASS: Class Notes
-
RESOURCES FROM CLASS:
-
TEST YOURSELF: Complete Worksheet 4
-
DO: Our ability to see patterns is what makes us human. However we also see patterns where none exist because our brains are biased towards detecting certain kinds of patterns over others (e.g. faces). Create a pattern by making something with a lot of repetition. Is the resulting pattern easy to see or hard to see? What would it mean to create the illusion of pattern? Can you predict what the pattern will be when you run your code or does it surprise you? You could take something you've already done where there was a lot of repetition in the code (e.g. your self-portrait) 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(~40min) in the learning p5.js series.
- Getting Started with p5.js chapters 9-10
-
RUN CODE
-
ASK * Post at least 1 question here. Need help on asking a question? * Name (optional): Question
- Your Name -- [Title of Blog Post](Link to Blog Post), [Title of Sketch](Link to Sketch) -- any other comments
- Jin - week 3 blog
- Mason -- week 4 blog, Pink Cafe Wall
- Kaisheng Cheng -- Week 4 blog, I cant sleep
- Alex -- Week 4 Blog, Full Color Butterfly
- Kai -- Week 4 Blog, Expandaball
- Shelia -- Week 4 Blog, monster teeth
- Pia -- Week 4 Blog,Aurora
- Madina -- Week 4 Blog,CentralAsianCarpetPattern
- Liang -- Week 4 Blog,Sticky board
- Yuhang Zhang week4 blog, pointppoinntt
- Brooklyn week4 blog, Controlled Chaos
- Hailey week4 blog, Be Here Now
-
RESOURCES FROM CLASS:
-
TEST YOURSELF: Complete Worksheet 3
-
DO: Two roads diverged in a yellow wood, And sorry I could not travel both... Life is full of difficult choices, use conditional statements to control the flow of your programs. Create a sketch that asks people to make difficult choices that have surprising consequences.
- Which choices are easier, harder? Which choices are false choices?
- What internal or external factors influence the choice? How do others’ choices affect your choices?
- What choices surprise you with unexpected outcomes?
- Can you combine choices to create hard-to-predict results? (Hint: Use && and ||)
- Work in Pairs Can you divide an idea into two parts and combine those parts? (e.g. One of you codes the input behaviors (if statement) and the other one codes the output behaviors (what to do if it’s true.) Can you swap sketches and riff off of your partner's work? Provide 1 sketch link per pair, however clearly describe who did what in the code.
-
READ / WATCH
- Videos 4.1-4.2(~25min) 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
-
ASK
- Post at least 1 question below. Examples of good questions...
- Why do we need a while loop if the draw() function itself already kind of acts like a loop function? What's the exact difference that might require a while loop instead of using an if statement in draw()?
- I’m still a little confused about how the changingframe variable works in the second sketch for HW3. (I think I understand but) I’m not fully sure why I need changingframe to store the previous frame, and how this helps detect when the mouse first enters the rectangle. Could you explain a bit more on the relationship in quesiton 2 of HW3?
- Why doesnt the circle move with the mouse even though all my if statements are declared- task 3
- Your Name -- [Title of Blog Post](Link to Blog Post), [Title of Sketch](Link to Code) -- any other comments
- Alex -- Week 3 Blog, Trolley Problems
- jiN -- Week 3 Blog
- Pia -- Week 3 blog,The buttons
- Mason -- Week 3 blog, Life or Death Door
- Yuhang Zhang -- Week 3 blog, teamwork:life or death Door
- Shelia, Kaisheng Cheng-- Week 3 Blog Post (Shelia), Week 3 Blog (Kai), team work - love me not
- Liang -- Week 3 blog, What Kind of Person Are You?
- Hailey -- Week 3 blog, Two Roads Diverged: Mindset Over Choice
- Kai -- Week 3 blog, The Tortoise and the Hare
- Madina -- Week 3 blog, Random Background if Button Pressed
- Zihuan -- Week 3 blog, Two Roads in a Yellow Wood
- Riya -- Week 3 catch up blog
-
RESOURCES FROM CLASS:
-
TEST YOURSELF: (Only use what we've learned so far: calling p5 functions and variables.) Worksheet ONLY POST WORK YOU WANT ME TO LOOK AT
-
DO:
- Consider the following cliches / pearls of wisdom: No man is an island. There is no such thing as a new idea. Everything is related to everything else. It’s all relative. The world is defined through relationships and those relationships shape our perspectives. Use variables to build in some relationships between two or more elements in your sketch and think about how the perception of what’s happening is different depending on which element's perspective you take on. Think about:
- What’s related to what?
- How are they related?
- Is it a positive or negative relationship? Example sketch.
- Is it an amplifying or diminishing relationship? Example sketch.
- You should definitely take a mathematical approach to answering these questions but you can also take a figurative, metaphorical approach.
- The elements common to all of your sketches are: position, dimensions, stroke thickness, color values. Can you relate one or more of these elements to:
- itself over time (so it changes over time)
- a different element in your sketch
- frameCount (which frame of animation is now)
- mouseX or mouseY or the combined (mouseX, mouseY) mouse position
- or something else!
- You can revisit your self-portrait to build relationships between features OR create something new.
- Consider the following cliches / pearls of wisdom: No man is an island. There is no such thing as a new idea. Everything is related to everything else. It’s all relative. The world is defined through relationships and those relationships shape our perspectives. Use variables to build in some relationships between two or more elements in your sketch and think about how the perception of what’s happening is different depending on which element's perspective you take on. Think about:
-
WATCH, READ, RUN CODE:
- Watch Conditionals 3.1 - 3.4 ~1hr
- Getting Started with p5: Chapter 5 (Response). | Chapter 5 Code
- Go further with Transformations (Optional)
- Transformations Video Tutorials
- Getting Started with p5: Chapters 6 (Transformations) and 8.10-8.15 (More complex motion)
-
ASK
- Post at least 1 question below. Examples of good questions...
- Boaty McBoatface -- [blog post](url to blog), [zoog]
- Jin Ma -- blog post
- Kaisheng Cheng -- blog post, Catch me if you can
- Pia -- Blog, 3circles
- Madina -- Sketch, ICM BLOG
- Mason Li -- Week 2 Blog, Self-Portrait in Motion
- Liang L -- Week2 blog, You look happy...or not?
- Yuhang Zhang -- Week 2 Blog,big ⚪
- Alex -- Week 2 blog, My world keeps raining
- Hailey -- Week 2 bolg, Love , Love-speed ver.
- Kai --Week Two blog, sketch
- Zihuan -- Week 2 bolg, [Moon]
- Shelia -- Week 2 blog, quirky cat
-
RESOURCES FROM CLASS:
-
SET UP:
- 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. ONLY POST WORK YOU WANT ME TO LOOK AT
- Create a "self" portrait (or anything that creatively inspires you) using 2D primitive shapes. Play with symmetry in your portrait. Shapes include –
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 an example: Zoog - Write no more than 5 sentences about how computation applies to your interests, due 24 hours before the next class. Pick one of the following to address (a,b, or c):
- Something you studied, a job, a hobby, or a cause you care about.
- Describe a project you want to make. Why do you want to make it?
- Describe a project your love. What do you appreciate about it that others don't always immediately get? (You can review and contribute to the ICM Inspiration Wiki page).
- In the same post (or a new one), point to one thing in your code that you'd like us to talk about in class. Cite the line number(s). Be prepared to talk about why it's interesting to you.
-
READ AND WATCH:
- Follow the TO THE LESSON Link:
- Watch before HW: Videos 1.1 - 1.6(~1h 15m)
- Watch after HW: Videos 2.1 - 2.3(~30m)
- 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.
- Follow the TO THE LESSON Link:
-
ASK
- Post at least 1 question below. Examples of good questions...
- Name (optional) -- Question: Why is it that this is like this and that is like that?
- How can I precisely move or scale all the points of a shape, such as a triangle, at the same time? For example, if I want to move the whole triangle to the right or make it bigger, how can I do that without changing every point manually?
- Why is background() sometimes placed under function setup() and other times under function draw()?
- In which case would you use arc() instead of bezier()?
Please make sure your posts are publicly accessible by testing them in an Incognito (Chrome) or Private Browser (Safari).
- Homework Links
-
Your Name -- [Title of Blog Post](Link to Blog Post), [Title of Sketch](Link to Sketch) -- any other
-
Kai Chang -- Notion Blog Post, Self portrait --
-
Kaisheng Cheng -- Week 1 Blog, "Self portrait"
-
Pia -- Week 1 How computation applies to my interests, week1-Matchaaa
-
Alex Zhou -- Blog1: Geometric Van Gogh, Portrait
-
Mason Li -- Week 1 Blog, self portrait
-
Yuhang Zhang -- Week1 Blog, portrait
-
Jin -- [Week 1 Blog]
-
Liang -- Week 1 Blog, Draw Me Like You're Three
-
Hailey Park -- Week 1 Blog, Self-portrait
-
Madina —- Week 1 ICM Blog , Madina’s Self Portrait
-
Shelia Xie —- Week 1 ICM Blog , Shelia’s Self Portrait
-