Skip to content

Instantly share code, notes, and snippets.

@jvcleave
Created October 4, 2012 17:28
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 jvcleave/3835128 to your computer and use it in GitHub Desktop.
Save jvcleave/3835128 to your computer and use it in GitHub Desktop.
ofRGBCube
#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