Settings

Theme

Drawing with boids

miniatureape.github.io

71 points by miniatureape 8 years ago · 9 comments

Reader

robotresearcher 8 years ago

Context: Boids is the name of a classic flocking model by Craig Reynolds.

https://www.red3d.com/cwr/boids/

codetrotter 8 years ago

I initially thought that it didn't work because it was just a black screen. Perhaps include a little text box that tells the user that they need to draw something with their mouse.

miniatureapeOP 8 years ago

Hi, I made this. Thanks for looking.

In case anyone is interested, if you open the console there are some instructions for scripting your own drawings.

(p.s. Thanks for all the suggestions)

tomxor 8 years ago

This is a lovely idea.

Emergent simulations are my favorite part of compsci, turning it towards an artistic purpose seems like a good pairing, I might steal it and try my luck with CA or something :)

[edit]

After playing for a bit I feel like it might be good to have the boids number and age limit a little higher by default (there is no correct setting of course, but it probably helps people get an intuition for what it's doing).

Also increasing max speed makes it much more expressive.

nafizh 8 years ago

Can someone please explain what is it doing? I thought it was giving whatever you draw, a more artistic expression, but it seems it does not preserve the original content.

  • Everlag 8 years ago

    Without looking at the code, it looks like its using a steering algorithm[0] to move a series of 'boids'(each individual stroke) along the path you define. A boid is controlled by a number of forces, as in the physics sense. By varying starting conditions for each boid, you get the dispersion that is seen on all figures but straight lines.

    If you take a look at the options(hamburger menu in the top left) you'll see a bunch of options. For example, 'maxForce' is the maximum magnitude of force that can be exerted on a boid for a period of time; this is noticeable if you draw two large 'C's, one with maxForce at min and one at max. I'd recommend cranking up 'boidSize' if you want to get a clearer idea of what's an individual boid is doing.

    Steering behaviors are used in a lot in games. For example, A* will give you a great path that looks terribly robotic. Using a steering behavior, perhaps 'seek' towards each path node then 'arrive' at the end of the path, you get significantly more organic movement.

    [0] https://www.red3d.com/cwr/steer/gdc99/

metaprinter 8 years ago

oooh, you an play with the settings from the hamburger menu

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection