Giter Site home page Giter Site logo

p5_lessons's Introduction

P5 Lessons

The following collection of p5 sketches and documents is meant to lead a new programmer through the basics, from sketching basic shapes, to adding motion, to creating data visualizations using API connections.

About p5.js

p5.js is a JavaScript library used for graphics, animation, and sound. It is based on Processing, a language that has gained popularity in the creative coding and audiovisual art community.

Setting up

The only thing that you will need to get these examples working is the p5 library. Download from the p5.js website.

You will want to place the entire p5 directory at the root of this repository.

Running the sketches

I won't make it difficult or force you to set-up much. Just drag the index.html in each lesson to the browser. The code you need to edit is in the corresponding js folder.

For each section, I've also included an example sketch that uses some of the methods you've learned (and then some). They will be more challenging to mimic yourself, but you can use it as an opportunity to jump ahead and experiment.

1. Drawing

While learning basic functionality in p5.js, we will also go over some general JavaScript basics.

  1. Drawing basic shapes

    • First we need to know how to draw basic shapes in p5.

    • Your challenge is to create your own Hello World sketch using rectangles, ellipses, and triangles.

  2. Draw shapes with loops

    • Don't do things manually that you could do in a loop.

    • Your challenge will be to make a tunnel of geometric shapes, using loops, and the primitives from 1.1.

2. Motion

As we start to use motion in some of our sketches, we will dig further into loops, objects, arrays, among others.

  1. The Draw Loop

    • To achieve motion in P5, you will need to call a method many times each second. Luckily that is where Draw() comes in!

    • Your challenge is to make a rainstorm!

  2. Meteor Shower

    • We will be creating a simple meteor shower effect, utilizing objects in JS

    • Your challenge create a "crash" effect!

p5_lessons's People

Contributors

aceslowman avatar ed42311 avatar georgiekirschner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.