Skip to content

Instantly share code, notes, and snippets.

@samatt
Created November 25, 2013 00:41
Show Gist options
  • Save samatt/7634563 to your computer and use it in GitHub Desktop.
Save samatt/7634563 to your computer and use it in GitHub Desktop.
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