We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello everyone; I have created a sphere in 3d and shake it randomly. now I would like to make it explode but I couldn't find out how. Can you help me please?
float x, y;
void setup () {
size (700, 700, P3D); //Im working in 3D so i added P3D
smooth ();
cam = new PeasyCam(this, 700);
x=10;
y=10;
}
void draw () {
background (0);
lights();
pushMatrix();
translate(x, y);
noStroke();
fill(255);
sphere(40);
popMatrix();
x += random(-5, 5);
y += random(-5, 5);
}
Answers
Hello @bk9696
Check this
https://processing.org/examples/explode.html
https://processing.org/examples/simpleparticlesystem.html
http://codegolf.stackexchange.com/questions/2571/most-compact-code-for-a-simulated-explosion
I believe this follows from your other discussion.
Keeping that in mind, you need to decide whether you want same size particles, or different sized, whether you want some other inter-particle forces, and the pattern of the explosion.