boxes perlin rotation
in
Programming Questions
•
2 years ago
hi! i want to have this box rotation different like a 2d perlin field. what am i doing wrong? ...please. thank you!
- import processing.opengl.*;
int distance = 25;
float h = 0;
float v = 0;
float perli = 0.0;
void setup () {
size (500, 500, OPENGL);
smooth ();
frameRate (30);
//ellipseMode (CENTER);
noStroke();
}
void draw () {
lights();
translate(50,50);
background(111);
for (float y = 0; y <= height-100; y = y + distance) {
for (float x = 0; x <= width-100; x = x + distance) {
pushMatrix();
translate(x, y, 0);
rotateY(h);
rotateX(v);
box(30);
popMatrix();
perli = perli + .1;
float n = noise(perli) * 0.001;
h = h + n;
v = v + n;
}
}
}
1