Hello,
I wrote a little more from your idea...
just for the fun of it...
You'll need PeasyCam.
Chrisir
Code:
// imports ================================================
/** opengl **/
// import processing.opengl.*;
/** PeasyCam **/
import peasy.*;
// vars =================================================
// Camera
PeasyCam cam;
CameraState MyState;
CameraState MyStateMove;
int numberOf = 3;
Cell [][] grid;
Cell [][] Limbo;
// program =======================================
void setup() {
// size(300,300,OPENGL);
size( 580, 480, P3D );
stroke (254);
cam = new PeasyCam(this, 400);
//cam.setMinimumDistance(250);
//cam.setMaximumDistance(600);
cam.pan(0,0);
cam.setDistance(1500);
cam.setResetOnDoubleClick (false);
//Cells
grid = new Cell[width][height];
Limbo = new Cell[width][height];
for (int i = 0; i < width; i ++ ) {
for (int j = 0; j < height; j ++ ) {
// Initialize each object
grid[i][j] = new Cell(i, j);
grid[i][j].x = i;
grid[i][j].y = j;
if (((i>100) && (i<200)) && ((j>100) && (j<200))) {
grid[i][j].variable[0] = 99;
}
else {
grid[i][j].variable[0] = 44;
}
Limbo[i][j] = new Cell(i, j);
Limbo[i][j].x = i;
Limbo[i][j].y = j;
}
}
}
void draw () {
background(0);
paintIt ();
}
void paintIt () {
for (int i = 0; i < width; i ++ ) {
for (int j = 0; j < height; j ++ ) {
// Initialize each object
grid[i][j].drawIt(); // = new Cell(i, j);
// Limbo[i][j].drawIt(); // = new Cell(i, j);
}
}
} // paintIt
class Cell{
int x, y;
float [] variable = new float [numberOf];
Cell(int xpos, int ypos) {
x = xpos;
y = ypos;
variable[0]=54;
variable[1]=14;
variable[2]=54;
}
void drawIt () {
stroke (color (variable[0],variable[1],variable[0]));
//point(x,y);
line (x,20,y,
x,20-variable[0],y);
}
} // class