Hi,
I need help designing a 3D Grid, like the pic below. I have more than half of it done, I just need the third plane.
Here’s the code I have so far:
int gridSize = 10;
float inc = 0.001;
int density = 10;
float znoise = 0.0;
void setup() {
size(800,800,P3D);
background(0);
smooth();
noFill();
stroke(255);
}
void draw(){
background(0,25,0);
pushMatrix();
translate(width/2, height/2);
for(int i = -width/2; i < width/2; i+=gridSize) {
for(int j = -height/2; j < height/2; j+=gridSize) {
int y = 200;
line(i, y, j, i+gridSize, y, j);
line(i, y, j, i, y, j+gridSize);
}
}
popMatrix();
float xnoise = 0.0;
float ynoise = 0.0;
for (int y = 0; y < 600; y += density) {
for (int x = 0; x < width; x += density) {
float n = noise(xnoise, ynoise, znoise) * 160;
fill(100, n, 100);
rect(x, y, density, density);
xnoise += inc;
}
xnoise = 0;
ynoise += inc;
}
znoise += inc;
}