Explosion

edited January 2017 in Library Questions

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);
}
Tagged:

Answers

Sign In or Register to comment.