You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for the wonderful work on code / videos / and your books.
Just wanted to post an enhancement for a variation for one of the exercises.
I'll call it Big-Bang.
It consists of exactly the same exercise (NOC_02forces_many_mutual_boundaries), but change the start position of all particles to the center of the screen.
Next generate a starting force and on each particle iteration, rotate the force so that each particle starts moving to a different angle simulating an explosion.
voidsetup() {
size(1500,1000);
for (inti = 0; i < movers.length; i++) {
movers[i] = newMover(random(1,2),width/2,height/2);
// Determine an angle so that all particles get a force in a unique direction ( 360 / amount of particles )floatangle = 360/movers.length;
// Create a force with a random X PVectorsome_force = newPVector(random(0,10),0);
// Rotate the force according to particle iPVectorforce = some_force.rotate(radians(angle*(i+1)));
// Apply the force to the particle so that when the program starts, each one is moving in a directionmovers[i].applyForce(force);
}
}
The text was updated successfully, but these errors were encountered:
Hi Daniel,
First of all, thanks for the wonderful work on code / videos / and your books.
Just wanted to post an enhancement for a variation for one of the exercises.
I'll call it Big-Bang.
It consists of exactly the same exercise (NOC_02forces_many_mutual_boundaries), but change the start position of all particles to the center of the screen.
Next generate a starting force and on each particle iteration, rotate the force so that each particle starts moving to a different angle simulating an explosion.
The text was updated successfully, but these errors were encountered: