Nature of Code + Openframeworks

Lately I’ve been attending a great course on Kadenze, taught by the awesome Daniel Shiffman, author of the book “The Nature of Code, simulating natural systems with processing”.
It was so inspiring!
So much that I decided to test some of the examples both in P5js and in Openframeworks (which I started learning few weeks ago).
I think that the classical Boids simulation invented by Craig Reynolds (and inspired on the works on Vehicles by Valentino Braitenberg) is a beautiful canvas for many many different applications. I also bought the book “I veicoli pensanti” by Braitenberg and I found it to be another really great source of inspiration.
After some playing around, here are some “things” that emerged from applying different rules to a basic boids simulations.



If you’re interested, check out my full article on Boids Simulation here!


  1. Hello!

    This is Kathy, I am learning P5.JS and become very interested in your project on boid simulation. Your digital portrait of Natalie Portman is amazing! I wonder if you can share with a little bit more on how you manage to detect the pixel color and transfer that to the line drawing via p5.js? Have you tried webcam drawing? Look forward to hearing from you and thank you sooo much!

    Best regards,

  2. Hi Kathy and thanks for the feedback! :)
    I simply load an image into Openframeworks (or P5js) and resize the canvas to match its size. Then when I start drawing the boids, each one of them picks up the color from the same coordinates in which he currently resides.
    If the boid is in (0,0) he will look for pixel color at image (0,0).
    The exact same thing could be done with a webcam feed, but the boids should draw a lot more quicker in order to keep track of the fps.. could be an interesting experiment, by the way! 😀
    I hope I’ve cleared up things.


Lascia una risposta

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *


È possibile utilizzare questi tag ed attributi XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">