Created
November 25, 2013 00:41
-
-
Save samatt/7634563 to your computer and use it in GitHub Desktop.
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
glPushMatrix(); | |
glTranslatef(0, ofGetHeight(), 0); | |
ofBeginShape(); | |
for (int i = 0; i <fftData.size(); i++){ | |
float val =fftMax - fftData[i] * 128; | |
// ofRect(i*rectWidth, 0, rectWidth,val); | |
// ofCircle(ofGetWidth()/2, -ofGetHeight()/2, val*100); | |
} | |
float x,y; | |
float radius = 100; | |
float centX = ofGetWidth()/2; | |
float centY = -ofGetHeight()/2 ; | |
for(int i =0; i< 360; i++){ | |
int index = ofMap(i, 0, 360, 0, fftData.size()); | |
float radVariance =ofMap(fftData[index], 0, fftMax, 0, 1); | |
float thisRadius = radCurve + radVariance*100; | |
float rad = ofDegToRad(i); | |
x = centX + (thisRadius * cos(rad)); | |
y = centY + (thisRadius * sin(rad)); | |
ofCurveVertex(x, y); | |
} | |
ofEndShape(); | |
glPopMatrix(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment