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