Sketch 2015-04-26
void ofApp::drawGrid() {
for(int i = 0; i < width * 0.1 + 10; i++) {
for(int j = 0; j < height * 0.1 + 10; j++) {
noise.x = noiseOffset.x + i * scaleX;
noise.y = noiseOffset.y + j * scaleY;
noise.z = noiseOffset.z + sineOfTheTime;
noiseValue = ofNoise(noise.x, noise.y, noise.z);
//http://natureofcode.com/book/chapter-3-oscillation#35-polar-vs-cartesian-coordinates
theta = noiseValue * 2 * PI;
x = r * cos(theta);
y = r * sin(theta);
ofPushMatrix();
ofTranslate(i * 10, j * 10);
ofEnableBlendMode(OF_BLENDMODE_ADD);
if(j % 2 == 0){
ofSetColor(180, 231, 248, 150);
ofRect(0, 0, x, y);
} else {
ofSetColor(255, 180, 180, 128);
ofLine(0, 0, x, y);
}
ofDisableBlendMode();
ofPopMatrix();
}
}
}
Perlin noise coupled with a little polar to cartesian conversion.