Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include "testApp.h"
#include <ofGraphics.h>
void testApp::setup(){
ofSetFrameRate(60);
ofEnableSmoothing();
ofBackground(255);
ofSetColor(0);
f = 0;
}
void testApp::update(){
f += 0.05;
}
void testApp::draw(){
float f2 = f;
for (int x = 0; x < ofGetWidth(); x++) {
float n = ofNoise(f2);
float y = ofMap(n, 0, 1, 0, ofGetHeight());
ofRect(x, y, 1, 1);
f2 += 0.01;
}
}
#include "testApp.h"
#include <ofGraphics.h>
void testApp::setup(){
ofSetFrameRate(50);
ofEnableSmoothing();
ofBackground(255);
ofSetColor(0);
}
void testApp::update(){
}
void testApp::draw(){
for (int x = 0; x < ofGetWidth(); x++) {
for (int y = 0; y < ofGetHeight(); y++) {
float c = ofNoise(x * 0.01, y * 0.01) * 255;
ofSetColor(c);
ofRect(x, y, 1, 1);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment