ArrayLists & PVector


float a = 0.0;

color black = #F6CC4B;
color white = #333436;
color red = #F6CC4B;

ArrayList<PVector> points = new ArrayList<PVector>();

void setup() {
  background(black);
  size(1000, 600, P3D);

  noFill();

  stroke(white);

}


void draw() {
  background(black);

  strokeWeight(10);

  float x = sin(radians(a))*cos(radians(a*20.5))*sin(radians(a*6))*width/4;
  float y = sin(radians(a))*cos(radians(a/2))*width/3;  
  float z = sin(radians(a)*4)*sin(radians(a)*4)*width/3;
  float simplesin = map(sin(radians(a)), -1, 1, 0.4, 2);
pushMatrix();
  translate(width/2, height/2);
  scale(simplesin);
  rotateY(radians(a));
  rotate(radians(a));

  points.add(new PVector(x, y, z));
  for (PVector v : points) {

    point(v.x, v.y, v.z);
        point(-v.x, -v.y, -v.z);
  }
  popMatrix();

  if (points.size() > 50){
  points.remove(0);
  }


  a = a + 0.3;  
  gif(400, 5);
  println(gifframecount);
  println(a);
}

results matching ""

    No results matching ""