//peasy cam import peasy.org.apache.commons.math.*; import peasy.*; import peasy.org.apache.commons.math.geometry.*; PeasyCam cam; Cube stage; // external large cube Cube stage2; // internal cube int cubies = 800; int cubies2 = 200; Cube[]c = new Cube[cubies]; // internal little cubes color[][]quadBG = new color[cubies][6]; //movement float[]x = new float[cubies]; float[]y = new float[cubies]; float[]z = new float[cubies]; float[]xSpeed = new float[cubies]; float[]ySpeed = new float[cubies]; float[]zSpeed = new float[cubies]; //rotation float[]xRot = new float[cubies]; float[]yRot = new float[cubies]; float[]zRot = new float[cubies]; // size of external cube float bounds = 640; //size for smaller cube float bounds2 = 320; void setup(){ //size(640, 480, OPENGL); size(640, 480, P3D); cam = new PeasyCam(this, 300); cam.setMinimumDistance(50); cam.setMaximumDistance(500); for (int i=0; ibounds/2 || x[i]<-bounds/2){ xSpeed[i]*=-1; } if (y[i]>bounds/2 || y[i]<-bounds/2){ ySpeed[i]*=-1; } if (z[i]>bounds/2 || z[i]<-bounds/2){ zSpeed[i]*=-1; } } //saveFrame("cubeinb-####.tif"); } class Point3D{ float x, y, z; // constructors Point3D(){ } Point3D(float x, float y, float z){ this.x = x; this.y = y; this.z = z; } }