Created
October 4, 2012 17:28
-
-
Save jvcleave/3835128 to your computer and use it in GitHub Desktop.
ofRGBCube
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 "testApp.h" | |
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
int dimensions = 256; | |
mesh.setMode(OF_PRIMITIVE_POINTS); | |
float direction = dimensions * 0.5 - 0.5; | |
for (int r=0; r<dimensions; r++) | |
{ | |
for (int g=0; g<dimensions; g++) | |
{ | |
for (int b=0; b<dimensions; b++) | |
{ | |
mesh.addColor(ofColor(r, g, b)); | |
mesh.addVertex(ofVec3f((r-direction), (g-direction), (b-direction))); | |
} | |
} | |
} | |
glPointSize(1); | |
} | |
//-------------------------------------------------------------- | |
void testApp::update(){ | |
ofSetWindowTitle(ofToString(ofGetFrameRate())); | |
} | |
//-------------------------------------------------------------- | |
void testApp::draw() | |
{ | |
camera.begin(); | |
mesh.draw(); | |
camera.end(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment