
Dandelion
Simulate dadelion by processing
I was always fascinated with the romance of dandelion, especially when being blown, its seeds flow with the wind, which demonstrates the amazing beauty of nature. So I wonder how cloud we perfectly simulating this kind of beauty with a computer. In order to make this experience more real, I manage to use the microphone from the computer as input, thus a specific algorithm, which only recognizes people’s blowing to the computer, is also required. And I programmed this visual effect in processing, with the minim sound library.
How to simulate the beauty of dandelion
Coding Test 1 (running with processing)

How does a single dandelion look like
I study the construction of how does a single dandelion look like, and use drawing to simulate its natural form.
How does a dandelion constuct itself
There're many ways of the construction of the dandelion, every different form has its unique beauty. In order to simulate in program, I choose to construct its form in two dimension.
How does it fly
Dandelion has its unique way of flying, which has to be lithe and beautiful. Therefore, when I simulate its way of flying, every individual unites of the seeds should possess its own speed, direction, and rotation.
Project Constructure
Every single seed of dandelion is separately loaded into the program, so every element could fly indepently driven byforce.
As soon as the seeds leave the dandelion, a slight sound effect is triggered in order to make the interaction more attractive.

I use processing as my coding environment.And I create a particle system to simulate the dandelion’s seeds and use minim library to play and receive the sounds.
In order to simulate the dandelion, I use Hooke's law, Newton's second law of motion,and I also apply gravity and air friction into the simulation.
I made a drawing of dandelion, because I would like the dandelion as real as possible. Only by making a sketch can the dandelion looks natural.
Like the natural process, I try to ensure the experience absolutely as the same as it was blown in wind, so I use the microphone as input that only recognizes blowing.
Screenshot of the program

Coding Test 2 (final version)
Processing code (parts)
import ddf.minim.*;
Minim minim;
Minim minim2;
AudioInput in;
float total,minus;
AudioSample kick;
AudioSample kick2;
float power, velocity, acceleration, location, friction, angle,windRate,w,power1;
PImage img, gen,back;
PVector [] flower=new PVector[48];
ArrayList<Flower> ff;
ArrayList<blowFlower> bf;
void setup() {
size(1000,700,P2D);
r=16;
minim = new Minim(this);
minim2 = new Minim(this);
in = minim.getLineIn();
kick = minim.loadSample( "1.mp3", // filename
512 // buffer size
);
kick2 = minim.loadSample( "2.mp3", // filename
512 // buffer size
);
total=0;
back=loadImage("back2.png");
gen=loadImage("gen.png");
ff= new ArrayList<Flower>();
bf=new ArrayList<blowFlower>();
for (int i=0; i<r; i++) {
flower[i*3]=new PVector(TWO_PI/r*i, 70);
flower[i*3+1]=new PVector(TWO_PI/r*i+PI/r, 50);
flower[i*3+2]=new PVector(TWO_PI/r*i+3*PI/r, 90);
}
randomSeed(19);
for (int o=0; o<48; o++) {
img=loadImage(int(random(1, 7))+".png");
ff.add(new Flower(img, flower[o]));
}
}
void draw() {
background(0);
blendMode(ADD);
imageMode(CENTER);
windAngle();
branchRotate();
if(angle<-0.2){
w=angle;
}else{
w=0;
}
windRate=map(w,-4,-0.2,100,0);
for (int i = ff.size()-1; i >= 0; i--) {
Flower f=ff.get(i);
if(random(100)>windRate){
f.run();
}else{
ff.remove(i);
bf.add(new blowFlower(f.img(),f.location(),angle));
if(random(1)>0.5){
kick.trigger();
}else{
kick2.trigger();
}
}
}
for(int o = bf.size()-1; o >= 0; o--){
blowFlower b=bf.get(o);
if(b.isDead()==false){
b.blow();
}else{
bf.remove(o);
}
}
if(ff.size()>48){
ff.remove(0);
}
sound();
applyWind();
}