-
Notifications
You must be signed in to change notification settings - Fork 3
Assignment 3
David Ahmad edited this page Jan 20, 2016
·
35 revisions
- Chapter 10: Getting Started with p5.js
- Transformations tutorial by Gene Kogan
- In class examples
- More examples
- Design a sketch in an object-oriented fashion. Try to eliminate code from
setup()anddraw()) except for the core requirements (createCanvas(),background(), etc.) and calls to objects. Your object can be anything but one thing you might consider is building a particle system. A particle system can be used to simulate: rain, snow, fireworks, explosions, smoke, etc. For this first step, you would create a singleParticleobject or maybe two on the screen using separate variables. Here are some steps you can follow: (don't need to do all of them!)- Make a sketch with a single shape moving around the screen.
- Group the variables together in an object literal.
- Put one or more functions (don't forget to refer to those variables with
this!) - Move the code for making the object into a constructor function.
- See if you can make two objects from the constructor function. How can they be different?
- In the end the goal is to have code in
draw()that only makes calls to objects. Something like:
function draw() {
background(0);
// Two objects of the same type
apple1.chop();
apple2.chop();
// Another object of a different type
orange.peel();
// etc.
}- Document the process of creating your homework in a blog post. What were you inspired by? What pitfalls did you run into? What could you not figure out how to do? What are your next steps?
- If you are embedding code, consider using a github gist.
- Consider incorporating more media into your blog posts, links to things that inspire you, images, embedded videos, etc.
- Contribute any questions below.
- your question
- Aadi: Cannon Game, [Blog Post] (http://aj1566.nyuad.im/blog/2016/01/08/homework-3/)
- Rami: [Boat game] (http://p5ide.herokuapp.com/view/568f4c5052187803006890a1), [Blog Post] (http://rha257.nyuad.im/blog/index.php/2016/01/08/homework-3/)
- Lucas: Solar System, Blog Post
- Tarmo: [Snowfall] (http://p5ide.herokuapp.com/view/568ecae92becba03000a8c1a) [Blog Post] (http://tk1578.nyuad.im/blog/2016/01/08/homework-4-blog-post/)
- Christos: [Super Nova] (http://p5ide.herokuapp.com/view/568f19d9521878030068908d), [Blog Post] (http://cz930.nyuad.im/blog/2016/01/08/part-iii-apocalypse/)
- Tanya: [Red Blood Cells floating through Plasma] (http://p5ide.herokuapp.com/view/568fad742cb2140300c7519c), [Blog Post] (http://tb1561.nyuad.im/blog/2016/01/08/assignment-three-a-visual-depiction-of-red-blood-cells-flowing-through-a-plasma-stream/)
- Mounir: [Fractal Fireworks] (http://p5ide.herokuapp.com/view/568f40535218780300689097), [Blog Post] (http://mke255.nyuad.im/blog/2016/01/08/fractal-fireworks/)
- David: [The NYU Flow] (http://p5ide.herokuapp.com/view/568fbe202cb2140300c751b9), [Blog Post] ( http://sa3904.nyuad.im/blog2/2016/01/19/finally-oop/)
- Shantanu: [Fireworks] (http://p5ide.herokuapp.com/view/568fd5242cb2140300c751cb), Blog Post
- Jin: [Random Pattern] (http://p5ide.herokuapp.com/view/568ef2745218780300689067) Blog Post
- Himal: [Bouncing balls with Collisions (Incomplete)] (http://p5ide.herokuapp.com/view/568fb8022cb2140300c751ac)
- Gene: [Moving Particles] (http://p5ide.herokuapp.com/view/568fb2792cb2140300c751a8), [Blog Post] (http://ec2911.nyuad.im/blog/2016/01/08/assignment-3-particles/)
- Chandan:[My animation] (http://p5ide.herokuapp.com/editor#?sketch=568f8e6f2cb2140300c7516b), [Blog Post] (http://ckm303.nyuad.im/blog/?p=9)