here goes mate, the rendering part of the code (main).
Code:
MyCamera cam;
int raio = 20;
int square = (raio*2) + 1;
int meshindex=0;
void setup()
{
size(800, 600, P3D);
setgrid();
cam = new MyCamera(60,-100,-100,60,0,0,0,0,1);
}
void draw() {
background(255);
//smooth();
//noStroke();
//hint(ENABLE_OPENGL_4X_SMOOTH);
ambientLight(50,50,50);
keyboard();
cam.Display();
drawMap();
}
void drawMap()
{
int q = 5;
for(int x=0;x<(raio*2);x++)
{
for(int y=0;y<(raio*2);y++)
{
noStroke(););
fill(0, 255,0);
beginShape(TRIANGLES);
vertex((x*q),(y*q), -grid[x][y][0]*q);
vertex((x*q),q + (y*q), -grid[x][y+1][0]*q);
vertex( q + (x*q), (y*q), -grid[x+1][y][0]*q);
vertex( q + (x*q), (y*q), -grid[x+1][y][0]*q);
vertex( (x*q), q + (y*q), -grid[x][y+1][0]*q);
vertex( q + (x*q), q + (y*q), -grid[x+1][y+1][0]*q);
endShape();
// gets the trees
objecto(grid[x][y][1],x*q,y*q,grid[x][y][0]*5);
fill(255, 0, 0);
}
}
// the blue thing
fill(0, 0,255,150);
beginShape(QUADS);
vertex(0,0,0);
vertex(0,200,0);
vertex(200,200,0);
vertex(200,0,0);
endShape();
}