Advertisement
memo

ofxkinect -> ofmesh

Apr 28th, 2011
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1.     mesh.clear();
  2.     mesh.setMode(OF_TRIANGLES_MODE);
  3.    
  4.     for(int j = 0; j < kh; j += pointStep) {
  5.         for(int i = 0; i < kw; i += pointStep) {
  6.             ofVec3f cur = kinect.getWorldCoordinateFor(i, j);
  7.            
  8.             if(cur.z >= nearThreshold && cur.z <= farThreshold) {
  9.                 mesh.addVertex(cur);
  10.                 mesh.addColor(pointColor.a > 0.5 ? pointColor : kinect.getCalibratedColorAt(i, j) * 1.0f/255.0f);
  11.             }
  12.         }
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement