Welcome


Web animations with p5.js


🍌Talk | Shriram A.

What is Processing? 🤔

Processing


  • A software for visual arts
  • Java based framework
  • Free and Open Source software
  • Download from Processing.org

Processing Flavours


  • Processing: Java mode
  • Processing.py: Python mode
  • p5.js: Javascript mode
  • Processing for android
  • Processing for Pi

Processing IDE


IDE

p5.js


  • Web based framework
  • No sofware needed (apart from browser)
  • Easy to integrate with webpages and publish
  • Can be used alongside other CSS and Javascript frameworks

Let's Get Started

The Canvas


canvas

Basic Functions


  • setup(), draw()
  • loop(), noLoop()
  • ellipse(x,y,a,b)
  • line(x1, y1, x2, y2)
  • rect(x,y,width,height)
  • e.t.c.

System Constants and Variables


  • width, height
  • mouseX, mouseY
  • PI, TWO_PI, HALF_PI, QUARTER_PI
  • mouseIsPressed, keyIsPressed
  • e.t.c

Example


Phyllotaxis


Flower plant

Smart Mother Nature


  • Optimal packing of $n$ seeds
  • For seed $i$
    • $r_i \propto \sqrt{i}$
    • $\theta_i = iG2\pi$
  • $G=$ 1.61803398875   The Golden Ratio

Result

Coding from Scratch

----------------------------or----------------------------

Explaination of Code

Other Sketches


Checkout


Resources