diff --git a/bin/data/new_tree.bin b/bin/data/new_tree.bin index 3309ba6..6003a14 100644 Binary files a/bin/data/new_tree.bin and b/bin/data/new_tree.bin differ diff --git a/bin/data/shaders/p_depth.vert b/bin/data/shaders/p_depth.vert index 0cfd3fd..cf16d18 100644 --- a/bin/data/shaders/p_depth.vert +++ b/bin/data/shaders/p_depth.vert @@ -19,14 +19,14 @@ void main() //float depth = pow(texture(tex1, tex_c).r, 2); vec2 depthCoord = texcoord * vec2(1920.0/2.0, 960.0); - float depth = pow(texture(tex1, depthCoord).r, 2); + float depth = texture(tex1, depthCoord).r; // Normalize the depth value between 0 and 1 based on min/max - float normalizedDepth = (depth) / threshold.y; + float normalizedDepth = (depth); vec4 displaced = position; - displaced.z = normalizedDepth * 800.0; + displaced.z = normalizedDepth * 400.0; // Transform the vertex position to clip space vec4 clipPos = modelViewProjectionMatrix * displaced; diff --git a/bin/image-to-mesh b/bin/image-to-mesh index c5354b9..c2a4d86 100755 Binary files a/bin/image-to-mesh and b/bin/image-to-mesh differ diff --git a/src/Bullet.cpp b/src/Bullet.cpp index 4504625..403e223 100644 --- a/src/Bullet.cpp +++ b/src/Bullet.cpp @@ -237,7 +237,7 @@ float Bullet::easeInOutCubic(float t) { float Bullet::calculateGridSize(float zoom){ const float ref_zoom = 0.01; - const float ref_scale = 20; + const float ref_scale = 40; float new_grid_size = (ref_zoom * ref_scale) / zoom; if(new_grid_size < 5){ new_grid_size = 5; diff --git a/src/network/Server.cpp b/src/network/Server.cpp index a7fbdd8..19aef4d 100644 --- a/src/network/Server.cpp +++ b/src/network/Server.cpp @@ -67,7 +67,6 @@ void Server::update(ofFbo& esp_comp){ /* check if inactive -> query vptree -> move camera */ checkActivity(); - //sendOSCMessage(); } void Server::disconnectAllClients(){ @@ -169,31 +168,11 @@ void Server::sendOSCMessage(){ ofxOscMessage me_2; ofxOscMessage me_3; ofxOscMessage me_file; + ofxOscMessage bang_new_mesh; - std::string audio_file = vp_resp.folder; - - // Check if file exists in a given dir - ofFile file("/home/cailean/Desktop/rave/all_wav_files/" + audio_file + ".wav"); - - if(!is_active && (audio_file != past_audio_file) && file.exists()){ - me_file.setAddress("/emote/filename"); - me_file.addStringArg(audio_file + ".wav"); - messages.push_back(me_file); - past_audio_file = audio_file; - } - - me_0.setAddress("/emote/0"); - me_0.addFloatArg(embedding.emotions["neutral"]); - messages.push_back(me_0); - me_1.setAddress("/emote/1"); - me_1.addFloatArg(embedding.emotions["neutral"]); - messages.push_back(me_1); - me_2.setAddress("/emote/2"); - me_2.addFloatArg(embedding.emotions["neutral"]); - messages.push_back(me_2); - me_3.setAddress("/emote/3"); - me_3.addFloatArg(embedding.emotions["neutral"]); - messages.push_back(me_3); + bang_new_mesh.setAddress("/emote/bang"); + bang_new_mesh.addTriggerArg(); + messages.push_back(bang_new_mesh); for (auto& msg : messages){ osc_sender.sendMessage(msg, false); diff --git a/src/ofApp.cpp b/src/ofApp.cpp index 1dd9a9d..c3fa6eb 100644 --- a/src/ofApp.cpp +++ b/src/ofApp.cpp @@ -300,7 +300,7 @@ void ofApp::drawPortrait(){ } // 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) { depth_onnx_portrait.SetPixels(model_portrait_out_fbo); depth_ready = true; @@ -319,8 +319,11 @@ void ofApp::drawPortrait(){ plane.mapTexCoords(0, 0, planeWidth, planeHeight); 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; + + /* 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 cellHeight = height/numY; - xPos += ofRandom(-cellWidth * 0.1, cellWidth * 0.1); - yPos += ofRandom(-cellHeight * 0.1, cellHeight * 0.1); + xPos += ofRandom(-cellWidth * 0.2, cellWidth * 0.2); + yPos += ofRandom(-cellHeight * 0.2, cellHeight * 0.2); } mesh.addVertex(glm::vec3(xPos, yPos, 0));