|
@ -300,7 +300,7 @@ void ofApp::drawPortrait(){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Give the depth processing some time to complete (adjust timeout as needed)
|
|
|
// Give the depth processing some time to complete (adjust timeout as needed)
|
|
|
const float PROCESS_TIMEOUT = 0.5; // half second timeout
|
|
|
const float PROCESS_TIMEOUT = 0.1; // half second timeout
|
|
|
if(!depth_ready && (current_time - last_process_time) > PROCESS_TIMEOUT) { |
|
|
if(!depth_ready && (current_time - last_process_time) > PROCESS_TIMEOUT) { |
|
|
depth_onnx_portrait.SetPixels(model_portrait_out_fbo); |
|
|
depth_onnx_portrait.SetPixels(model_portrait_out_fbo); |
|
|
depth_ready = true; |
|
|
depth_ready = true; |
|
@ -319,8 +319,11 @@ void ofApp::drawPortrait(){ |
|
|
plane.mapTexCoords(0, 0, planeWidth, planeHeight); |
|
|
plane.mapTexCoords(0, 0, planeWidth, planeHeight); |
|
|
custom_mesh = createCustomPlane(planeWidth, planeHeight, planeColumns, planeRows); |
|
|
custom_mesh = createCustomPlane(planeWidth, planeHeight, planeColumns, planeRows); |
|
|
|
|
|
|
|
|
ofLog() << "Generated new mesh at time: " << current_time; |
|
|
//ofLog() << "Generated new mesh at time: " << current_time;
|
|
|
mesh_ready = true; |
|
|
mesh_ready = true; |
|
|
|
|
|
|
|
|
|
|
|
/* send osc message when new node selected*/ |
|
|
|
|
|
server->sendOSCMessage(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -624,8 +627,8 @@ ofMesh ofApp::createCustomPlane(float width, float height, int numX, int numY) { |
|
|
float cellWidth = width/numX; |
|
|
float cellWidth = width/numX; |
|
|
float cellHeight = height/numY; |
|
|
float cellHeight = height/numY; |
|
|
|
|
|
|
|
|
xPos += ofRandom(-cellWidth * 0.1, cellWidth * 0.1); |
|
|
xPos += ofRandom(-cellWidth * 0.2, cellWidth * 0.2); |
|
|
yPos += ofRandom(-cellHeight * 0.1, cellHeight * 0.1); |
|
|
yPos += ofRandom(-cellHeight * 0.2, cellHeight * 0.2); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
mesh.addVertex(glm::vec3(xPos, yPos, 0)); |
|
|
mesh.addVertex(glm::vec3(xPos, yPos, 0)); |
|
|