OrbBit from Armando Rodriguez on Vimeo.
boolean record = false;
int formResolution = 1500;
float stepSize = 0.5;
float initRadius = 150;
float centerX, centerY, centerZ;
float[] x = new float[formResolution];
float[] y = new float[formResolution];
float[] z = new float[formResolution];
void setup(){
size(displayWidth, displayHeight,P3D);
smooth();
centerX =0;
centerY = 0;
centerZ = 0;
float angle = radians(20/float(formResolution));
float angle2 = radians(720/float(formResolution));
for (int i=0; i<formResolution; i++){
x[i] = sin(angle2*i*100) * cos(angle*i*100) * cos(angle*i*100) * initRadius;
y[i] = (sin(angle2*i*100) * sin(angle*i*100) * initRadius);
z[i] = cos(angle2*i*100) * initRadius;
}
stroke(0, 10);
background(255);
}
void draw(){
float zm = 250;
float sp = 0.01 * frameCount;
camera(zm, zm* cos(sp) , zm * sin(sp), 0, 0, 0, 0, 0, -1);
initRadius+= random(-stepSize,stepSize);
for (int i=0; i<formResolution; i++){
x[i] += random(-stepSize,stepSize);
y[i] += random(-stepSize,stepSize);
z[i] += random(-stepSize,stepSize);
}
colorMode(HSB, 350, 100, 100);
stroke(mouseY/2,100,100, 5);
strokeWeight(0.75);
noFill();
beginShape();
curveVertex(x[formResolution-1]+centerX, y[formResolution-1]+centerY,z[formResolution-1]+centerZ);
for (int i=0; i<formResolution; i++){
curveVertex(x[i]/1.5+centerX, y[i]/1.5+centerY,z[i]/1.5+centerZ);
}
curveVertex(x[0]+centerX, y[0]+centerY,z[0]+centerZ);
curveVertex(x[1]+centerX, y[1]+centerY,z[1]+centerZ);
endShape();
strokeWeight(5);
for (int i=0; i<formResolution; i++){
point(x[i]+centerX, y[i]+centerY,z[i]+centerZ);
}
stroke(mouseX/2,mouseX/2,100, 5);
strokeWeight(0.75);
noFill();
beginShape();
curveVertex(x[formResolution-1]+centerX, y[formResolution-1]+centerY,z[formResolution-1]+centerZ);
for (int i=0; i<formResolution; i++){
curveVertex(x[i]+centerX, y[i]+centerY,z[i]+centerZ);
}
curveVertex(x[0]+centerX, y[0]+centerY,z[0]+centerZ);
curveVertex(x[1]+centerX, y[1]+centerY,z[1]+centerZ);
endShape();
pushMatrix();
rectMode(CENTER);
noStroke();
fill(0,10);
box(5000);
rotateX(sp*10000);
noFill();
popMatrix();
}