Skip to content

Instantly share code, notes, and snippets.

@darrenmothersele
Created December 9, 2013 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenmothersele/7875942 to your computer and use it in GitHub Desktop.
Save darrenmothersele/7875942 to your computer and use it in GitHub Desktop.
#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