import peasy.PeasyCam; PeasyCam cam; int num = 888; float noise_scale = 0.05f; float z_scale = 30f; float radius = 60f; float min_size = 20f; float rotation = 0.0f; int counter = 0; void setup() { size(800, 600, P3D); //fullScreen(P3D, 2); cam = new PeasyCam(this, 500); strokeWeight(1.2); } float angle_offset = 0f; void draw() { background(255, 220, 234); if (counter > 100) { rotateZ(rotation); rotateY(rotation*0.2); rotation += 0.0004f; } angle_offset += 0.00004f; float angle_step = TWO_PI / (num-1); for (float angle = angle_offset; angle < TWO_PI+angle_offset-angle_step; angle += angle_step) { float distance = radius; float x = distance * cos(angle); float y = distance * sin(angle); float z = calcHeight(x, y, distance); // First point in multi-line PVector prev = new PVector(x, y, z); float size = min_size * (1 + 8 * noise(x, y)); float dist_step = 1.3f; for (distance += dist_step; distance < radius+size; distance += dist_step) { x = distance * cos(angle); y = distance * sin(angle); z = calcHeight(x, y, distance); stroke(60, 60, 80, 1.5f*(distance-radius-20)); line(prev.x, prev.y, prev.z, x, y, z); prev.set(x, y, z); } distance = radius+size; x = distance * cos(angle); y = distance * sin(angle); z = calcHeight(x, y, distance); line(prev.x, prev.y, prev.z, x, y, z); } counter += 1; } float calcHeight(float x, float y, float dist) { return noise(x*noise_scale, y*noise_scale) * z_scale + 20*log(dist-radius-min_size+0.001f) - 42; }