diff --git a/bin/data/new_tree.bin b/bin/data/new_tree.bin index ce77b71..74fceae 100644 Binary files a/bin/data/new_tree.bin and b/bin/data/new_tree.bin differ diff --git a/bin/image-to-mesh b/bin/image-to-mesh index 768cd3d..1ac1f1f 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 862de08..25e793c 100644 --- a/src/Bullet.cpp +++ b/src/Bullet.cpp @@ -39,6 +39,7 @@ void Bullet::update(bool& is_controller_active, Node& chosen_node, vector contr_active = is_controller_active; if(chosen_node.tsne_position != last_chosen_node.tsne_position){ + ofLog() << "new target!"; new_chosen_node = true; is_random_walking = false; time_at_target = 0; diff --git a/src/Bullet.h b/src/Bullet.h index 7b56ba7..31fde14 100644 --- a/src/Bullet.h +++ b/src/Bullet.h @@ -165,13 +165,13 @@ class Bullet{ Node* current_target_node = nullptr; /* random walk vars */ - const float RANDOM_WALK_RADIUS = 1000.0f; + const float RANDOM_WALK_RADIUS = 700.0f; const float RANDOM_WALK_SPEED = 25.0f; // Adjust for slower/faster movement const float TARGET_REACHED_DISTANCE = 5.0f; - const float RANDOM_WALK_DELAY = 5.0f; // 5 seconds delay + const float RANDOM_WALK_DELAY = 10.0f; // 5 seconds delay - const float SCALE_OUT_START_TIME = 15.0f; // When to start scaling out - const float SCALE_OUT_DURATION = 30.0f; // How long to scale out + const float SCALE_OUT_START_TIME = 30.0f; // When to start scaling out + const float SCALE_OUT_DURATION = 60.0f; // How long to scale out const float INITIAL_SCALE = 0.05f; // Starting scale const float TARGET_SCALE = 0.2f; // Final scale diff --git a/src/ofApp.cpp b/src/ofApp.cpp index 40237df..3a5dd6e 100644 --- a/src/ofApp.cpp +++ b/src/ofApp.cpp @@ -40,6 +40,7 @@ void ofApp::setup(){ } /* of settings (not sure why putting this at the start of setup breaks the map - but it works!) */ + ofSetVerticalSync(true); ofDisableArbTex(); ofEnableDepthTest(); @@ -420,12 +421,48 @@ void ofApp::drawPortraitZ(){ portrait_camera.begin(); ofEnableDepthTest(); - float time = ofGetElapsedTimef() / 10; + float time = ofGetElapsedTimef() / 20; float p_noise_x = ofSignedNoise(time, time) * 20; float p_noise_y = ofSignedNoise(time + 100, time + 100) * 20; + + + // Second plane with offset + ofPushMatrix(); + p_depth.begin(); + p_depth.setUniform1f("gridSize", g_size); + p_depth.setUniform2f("resolution", glm::vec2(portrait_fbo.getWidth(), portrait_fbo.getHeight())); + p_depth.setUniform2f("threshold", glm::vec2(minDepth, max_r)); + p_depth.setUniformTexture("tex0", tex_color, 0); + p_depth.setUniformTexture("tex1", tex_depth, 1); + ofFill(); + // Offset the second plane - adjust these values as needed + ofTranslate(p_noise_x - 50, p_noise_y - 0, -150); // moved right (+200), up (+100) and back (-300) + ofRotateDeg(60, 0, 1, 0); + plane.draw(); + p_depth.end(); + ofPopMatrix(); + ofDisableDepthTest(); + + // Second plane with offset ofPushMatrix(); + p_depth.begin(); + p_depth.setUniform1f("gridSize", g_size); + p_depth.setUniform2f("resolution", glm::vec2(portrait_fbo.getWidth(), portrait_fbo.getHeight())); + p_depth.setUniform2f("threshold", glm::vec2(minDepth, max_r)); + p_depth.setUniformTexture("tex0", tex_color, 0); + p_depth.setUniformTexture("tex1", tex_depth, 1); + ofFill(); + // Offset the second plane - adjust these values as needed + ofTranslate(p_noise_x - 140, p_noise_y - 0, -150); // moved right (+200), up (+100) and back (-300) + ofRotateDeg(-60, 0, 1, 0); + plane.draw(); + p_depth.end(); + ofPopMatrix(); + ofDisableDepthTest(); + + ofPushMatrix(); p_depth.begin(); p_depth.setUniform1f("gridSize", g_size); p_depth.setUniform2f("resolution", glm::vec2(portrait_fbo.getWidth(), portrait_fbo.getHeight())); @@ -437,7 +474,6 @@ void ofApp::drawPortraitZ(){ plane.draw(); p_depth.end(); ofPopMatrix(); - ofDisableDepthTest(); portrait_camera.end(); } @@ -654,9 +690,9 @@ void ofApp::keyPressed(int key) { // cam_pos_idx++; // if(cam_pos_idx > cam_positions.size() - 1) // cam_pos_idx = 0; - // portrait_camera.setPosition(cam_positions[cam_pos_idx].position); - // portrait_camera.setOrientation(cam_positions[cam_pos_idx].rotation); - // portrait_camera.setScale(cam_positions[cam_pos_idx].scale); + portrait_camera.setPosition(cam_positions[cam_pos_idx].position); + portrait_camera.setOrientation(cam_positions[cam_pos_idx].rotation); + portrait_camera.setScale(cam_positions[cam_pos_idx].scale); case 'p': if(bullet.print_debug){ bullet.print_debug = false;