Skip to content

Commit

Permalink
don't really need to switch off color any more. flipped the z axis al…
Browse files Browse the repository at this point in the history
…so so everything makes sense
  • Loading branch information
kylemcdonald committed May 4, 2011
1 parent 8e2ab81 commit 12fdc42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
27 changes: 9 additions & 18 deletions CombineImages/src/testApp.cpp
Expand Up @@ -37,7 +37,6 @@ void testApp::setup() {

curImage = 0;
reloadImage = true;
useColor = true;
}

const float
Expand Down Expand Up @@ -69,10 +68,10 @@ void testApp::updatePointCloud() {
int i = 0;

/*
principalPoint.x += ofMap(mouseX, 0, ofGetWidth(), -4, 4);
principalPoint.y += ofMap(mouseY, 0, ofGetHeight(), -4, 4);
cout << "fudge: " << ofMap(mouseX, 0, ofGetWidth(), -4, 4) << "x" << ofMap(mouseY, 0, ofGetHeight(), -4, 4) << endl;
*/
principalPoint.x += ofMap(mouseX, 0, ofGetWidth(), -4, 4);
principalPoint.y += ofMap(mouseY, 0, ofGetHeight(), -4, 4);
cout << "fudge: " << ofMap(mouseX, 0, ofGetWidth(), -4, 4) << "x" << ofMap(mouseY, 0, ofGetHeight(), -4, 4) << endl;
*/

for(int y = 0; y < h; y++) {
for(int j = 0; j < w; j++) {
Expand Down Expand Up @@ -144,23 +143,19 @@ void testApp::draw() {
glEnable(GL_DEPTH_TEST);

glPushMatrix();
glScaled(1, -1, 1);
glScaled(1, -1, -1);

ofDrawAxis(100);

ofSetColor(255);
curColor.draw(0, 0, curColor.getWidth(), curColor.getHeight());

glEnableClientState(GL_VERTEX_ARRAY);
if(useColor) {
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(3, GL_FLOAT, sizeof(Point3f), &(pointCloudColors[0].x));
}
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(3, GL_FLOAT, sizeof(Point3f), &(pointCloudColors[0].x));
glVertexPointer(3, GL_FLOAT, sizeof(Point3f), &(pointCloud[0].x));
glDrawArrays(GL_POINTS, 0, pointCloud.size());
if(useColor) {
glDisableClientState(GL_COLOR_ARRAY);
}
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);

glDisable(GL_DEPTH_TEST);
Expand All @@ -180,7 +175,7 @@ void testApp::draw() {
}

curCalibration->draw3d(curImage);

glPopMatrix();

cam.end();
Expand All @@ -195,8 +190,4 @@ void testApp::keyPressed(int key) {

curImage = ofClamp(curImage, 0, kinectList.size() - 1);
reloadImage = true;

if(key == 'v') {
useColor = !useColor;
}
}
1 change: 0 additions & 1 deletion CombineImages/src/testApp.h
Expand Up @@ -45,5 +45,4 @@ class testApp : public ofBaseApp {

int curImage;
bool reloadImage;
bool useColor;
};

0 comments on commit 12fdc42

Please sign in to comment.