Created
November 4, 2012 14:12
-
-
Save gregkepler/4012083 to your computer and use it in GitHub Desktop.
Cinder Noise Range Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cinder/app/AppBasic.h" | |
#include "cinder/Perlin.h" | |
#include "cinder/Rand.h" | |
using namespace ci; | |
using namespace ci::app; | |
using namespace std; | |
class NoiseRangeTest : public AppBasic { | |
public: | |
void setup(); | |
}; | |
void NoiseRangeTest::setup() | |
{ | |
Perlin mPerlin = Perlin(); | |
mPerlin.setSeed(clock()); | |
float v = randFloat(); | |
float lowest = 0.0; | |
float highest = 0.0; | |
for(int i=0; i<1000000; i++){ | |
float n = mPerlin.fBm(v); | |
//float n = mPerlin.noise(v); | |
if(n < lowest) lowest = n; | |
if(n > highest) highest = n; | |
v+= .01; | |
} | |
console()<< lowest << " : " << highest << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quick script to test the range of values you get from perlin noise in Cinder.