Skip to content

Instantly share code, notes, and snippets.

@obviousjim
Created July 23, 2013 06:13
Show Gist options
  • Save obviousjim/6060216 to your computer and use it in GitHub Desktop.
Save obviousjim/6060216 to your computer and use it in GitHub Desktop.
Using matrices to combine 4 kinect meshes
DRAW CODE:
cam.begin();
glPointSize(4);
ofSetColor(ofColor::green, 128);
West_SouthWest.checkPointMesh.drawVertices();
West_SouthWest.renderer.getMesh().drawVertices();
ofPushMatrix();
ofMultMatrix(westToSouth);
ofSetColor(ofColor::red, 128);
South_SouthEast.checkPointMesh.drawVertices();
South_SouthEast.renderer.getMesh().drawVertices();
ofPushMatrix();
ofMultMatrix(southToEast);
ofSetColor(ofColor::yellow);
East_NorthEast.checkPointMesh.drawVertices();
ofSetColor(ofColor::yellow,128);
East_NorthEast.renderer.getMesh().drawVertices();
ofPushMatrix();
ofMultMatrix(eastToNorth);
ofSetColor(ofColor::blue, 128);
North_NorthEast.checkPointMesh.drawVertices();
North_NorthEast.renderer.getMesh().drawVertices();
ofPopMatrix(); //pop east -> north
ofPopMatrix(); //pop south -> east
ofPopMatrix(); //pop west -> south
ofSetColor(128);
glPointSize(1);
cam.end();
MATRICES:
East To North
[ 0.981072, 0.00656891, -0.0347343, 0
-0.0108849, 0.0552883, -0.978296, 0
-0.0170464, 0.989516, 0.064136, 0
88.1066, -2478.57, 2317.1, 1 ]
South To East
[ 0.98549, 0.000936639, 0.0545441, 0
0.0457432, -0.0533124, -0.966846, 0
0.0139733, 0.979619, -0.0116734, 0
-94.4681, -2407.71, 2395.83, 1 ]
West To South
[ 0.98549, 0.000936639, 0.0545441, 0
0.0457432, -0.0533124, -0.966846, 0
0.0139733, 0.979619, -0.0116734, 0
-94.4681, -2407.71, 2395.83, 1 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment