Announcements
- Record session
- Student lead discussions (after break): Yoki and Andy
- Please keep your video on, unless there are issues of privacy. I need the feedback from your faces so that I know if I’m making sense or not.
Today’s lecture: P5.js!
- Visit openprocessing.org
- Save sketch (creates your account)
- Click on “Create a Sketch”
- e.g. mine
What is the difference between Processing and P5.js?
- Runs in browser so visitors don’t need to install anything
- It’s actually a different language. Processing is Java, while P5.js is Javascript (very little relation to Java)
- Openprocessing.org includes Javascript and the necessary libraries to run your P5.js program. You can download and install these on your laptop if you wish
- But it won’t be available to anyone else on the internet
- Guide to transitioning from Processing
Learning P5.js
- Reference page
- Tutorials and examples,
- Daniel Shiffman has a series of video tutorials on P5.js
- These start from the beginner stage, so you can skip the first few and jump around e.g.
- Objects
- Arrays
- Perlin noise
- Much of the documentation on p5js.org assumes you’re downloading and running from your laptop. Since we’re running on openprocessing.org, you can ignore this part.
Note from class
Working with openprocessing.org
- How to create a new sketch in openprocessing.org
- Log in, if you’re not
- Hover over the circle thing in the top left corner
- Click on the ‘+’ sign next to the word “Sketches”
- It is possible to run your Processing sketches to openprocessing.org if you switch the “engine”:
- Create a new sketch as above
- Copy your Processing sketch from your laptop and paste it into the sketch on openprocessing.org
- Press the 3 dots (also called a “hamburger”) to open the settings panel
- Select the “Sketch” tab
- Select the “Processingjs” engine (first line)
- How to add libraries to your sketch
- Press the 3 dots (also called a “hamburger”) to open the settings panel
- Select the “Sketch” tab
- Select the “Processingjs” engine (first line)
- Under “Libraries” you will see “p5.dom” and “p5.sound”. Turn on the sound library if that’s what you need.
- (My sound example worked fine once I did this)
- If you need other libraries, press the “Show All” button and scroll down until you find the library or libraries you need
Game of Life
The Game of Life example I showed you is here. You can also run it on openprocessing.org here. This is an example of a Processing sketch running with no changes on openprocessing.org by using the Processingjs engine.
Homework due Tuesday May 12
Get started on your final project.
- I expect to see substantial progress.
- Break a large project into smaller pieces
- Focus on the critical components first, not the optional features, in case you run out of time.