|
|
@ -7,6 +7,10 @@ void ofApp::setup(){ |
|
|
|
ofSetVerticalSync(true); |
|
|
|
window_width = 1512; |
|
|
|
window_height = ofGetWindowHeight(); |
|
|
|
ofx::piMapper::VideoSource::enableAudio = false; |
|
|
|
ofx::piMapper::VideoSource::useHDMIForAudio = false; |
|
|
|
projection_mapper.registerFboSource(quad_src); |
|
|
|
projection_mapper.setup(); |
|
|
|
|
|
|
|
/* load font */ |
|
|
|
tf.load("data/fonts/jetbrainsmono-regular.ttf", 20); |
|
|
@ -38,6 +42,7 @@ void ofApp::setup(){ |
|
|
|
|
|
|
|
/* Shader output */ |
|
|
|
rampedFbo.allocate(window_width, window_height); |
|
|
|
quad_src.setFbo(&rampedFbo); |
|
|
|
|
|
|
|
emoteImage.allocate(260, 260); |
|
|
|
tempImage.allocate(emoteImage.getWidth(), emoteImage.getHeight(), OF_IMAGE_COLOR); |
|
|
@ -116,6 +121,8 @@ void ofApp::update(){ |
|
|
|
std::cout << "Model did not run" << std::endl; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
projection_mapper.update(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -144,7 +151,10 @@ void ofApp::draw(){ |
|
|
|
tf.drawString(std::to_string(ofGetFrameRate()), 10, 30); |
|
|
|
ofPopMatrix(); |
|
|
|
|
|
|
|
printEmotions(); |
|
|
|
// printEmotions();
|
|
|
|
|
|
|
|
// send final fbo (ramp.fbo) to pi_mapper
|
|
|
|
//projection_mapper.draw();
|
|
|
|
|
|
|
|
// emoteImage.draw(640, 0);
|
|
|
|
// for(auto& face : detected_faces){
|
|
|
@ -198,15 +208,12 @@ void ofApp::inferEmotionalState(){ |
|
|
|
*/ |
|
|
|
void ofApp::renderDepthMap(){ |
|
|
|
rampedFbo.begin(); |
|
|
|
|
|
|
|
depthToColourShader.begin(); |
|
|
|
depthToColourShader.setUniformTexture("tex0", screen_fbo.getTexture(), 0); |
|
|
|
depthToColourShader.setUniform1f("texW", rampedFbo.getWidth()); |
|
|
|
depthToColourShader.setUniform1f("texH", rampedFbo.getHeight()); |
|
|
|
screen_fbo.draw(0, 0); |
|
|
|
depthToColourShader.end(); |
|
|
|
img.draw(0, 0); |
|
|
|
|
|
|
|
rampedFbo.end(); |
|
|
|
|
|
|
|
rampedFbo.draw(0,0); |
|
|
@ -234,34 +241,32 @@ void ofApp::displayFrame(){ |
|
|
|
|
|
|
|
//--------------------------------------------------------------
|
|
|
|
void ofApp::keyPressed(int key){ |
|
|
|
// if (key=OF_KEY_LEFT){
|
|
|
|
// player.SetRandomFrame();
|
|
|
|
// }
|
|
|
|
projection_mapper.keyPressed(key); |
|
|
|
} |
|
|
|
|
|
|
|
//--------------------------------------------------------------
|
|
|
|
void ofApp::keyReleased(int key){ |
|
|
|
|
|
|
|
projection_mapper.keyReleased(key); |
|
|
|
} |
|
|
|
|
|
|
|
//--------------------------------------------------------------
|
|
|
|
void ofApp::mouseMoved(int x, int y ){ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//--------------------------------------------------------------
|
|
|
|
void ofApp::mouseDragged(int x, int y, int button){ |
|
|
|
|
|
|
|
projection_mapper.mouseDragged(x, y, button); |
|
|
|
} |
|
|
|
|
|
|
|
//--------------------------------------------------------------
|
|
|
|
void ofApp::mousePressed(int x, int y, int button){ |
|
|
|
|
|
|
|
projection_mapper.mousePressed(x, y, button); |
|
|
|
} |
|
|
|
|
|
|
|
//--------------------------------------------------------------
|
|
|
|
void ofApp::mouseReleased(int x, int y, int button){ |
|
|
|
|
|
|
|
projection_mapper.mouseReleased(x, y, button); |
|
|
|
} |
|
|
|
|
|
|
|
//--------------------------------------------------------------
|
|
|
|