Browse Source

ok final

master
cailean 2 months ago
parent
commit
69a7cbd378
  1. BIN
      bin/data/new_tree.bin
  2. BIN
      bin/image-to-mesh
  3. 1
      src/Bullet.cpp
  4. 8
      src/Bullet.h
  5. 46
      src/ofApp.cpp

BIN
bin/data/new_tree.bin

Binary file not shown.

BIN
bin/image-to-mesh

Binary file not shown.

1
src/Bullet.cpp

@ -39,6 +39,7 @@ void Bullet::update(bool& is_controller_active, Node& chosen_node, vector<Node*>
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;

8
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

46
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;

Loading…
Cancel
Save