// planetoids // - a planetoid simulator // // based on some SWF code I found, not attributed to anyone // // Scott "Jerry" Lawrence // float[] x = new float[100]; // x positions of planetoids float[] y = new float[100]; // y positions of planetoids float[] z = new float[100]; // z positions of planetoids color[] c = new color[100]; // colors of planetoids int nplanetoids=90; // number of planetoids void setup() { size( 300, 300 ); background( 0,0,0 ); colorMode( HSB, 100 ); // create the initial universe for( int j=0 ; jwidth) || (ty<-20) || (ty>height) ) newPlanetoid( j ); } } // newPlanetoid -- generate a new planetoid void newPlanetoid( int idx ) { x[idx] = -500 + random(1000); y[idx] = -500 + random(1000); z[idx] = random(2); noStroke(); // Hue - 1..100 / 100 // Shade - 40..60 / 100 // Value - 75..100 / 100 c[idx] = ( color( random( 100 ), 40 + random( 20 ), 75+random(25) )); }