Hi guys ,
I am using ofxAssimpModelLoader for lodaing my 3D model.
In the mean time, I also trying to get the pointcloud mesh of my tracked body (by Kinect) on the screen.
But the 3D model has always covered the pointcloud mesh.
(foreground --> 3D model , background --> pointcloud mesh)
Is there any ways to reverse the orders?
Here is the code.
ofBackgroundGradient(ofColor::gray, ofColor::black, OF_GRADIENT_CIRCULAR);
/*
3d model
*/
ofSetColor(200);
ofEnableBlendMode(OF_BLENDMODE_ALPHA);
ofEnableDepthTest();
ofEnableLighting();
glShadeModel(GL_SMOOTH); //some model / light stuff
light.enable();
material.begin();
ofEnableSeparateSpecularLight();
ofPushMatrix();
model.setRotation(0,10,1,0,0);
model.setRotation(1,25,0,1,0);
//model.setRotation(2,30,0,0,1);
ofTranslate(220, 100, 0);
model.setScale(3,3,3);
model.drawFaces();
ofPopMatrix();
/*
kinect tracking
*/
ofPoint ltpoint(hand_Threshold_x_left,hand_Threshold_y_top);
ofPoint rtpoint(hand_Threshold_x_right,hand_Threshold_y_top);
ofPoint ldpoint(hand_Threshold_x_left,hand_Threshold_y_down);
ofPoint rdpoint(hand_Threshold_x_right,hand_Threshold_y_down);
oWidth = _Display.getWidth();
oHeight = _Display.getHeight();
//pointcloud play------
ofPushMatrix();
cam.begin();
ofScale(2, -2, 2); // flip the y axis and zoom in a bit
//ofRotateY(90);
ofTranslate(-pointcloudimage.getWidth() / 2, -pointcloudimage.getHeight() / 2);
pointcloudmesh.draw();
ofPopMatrix();
cam.end();
pointLight.disable();
pointLight2.disable();
pointLight3.disable();
material.end();
ofDisableDepthTest();
light.disable();
ofDisableLighting();
ofDisableSeparateSpecularLight();
pointcloudmesh.clear();