Permalink
Browse files

Merge branch 'master' of github.com:kylemcdonald/ofxFaceTracker

  • Loading branch information...
2 parents 85bfbac + 9465eff commit 642b5645f493d11ad54f36585af7e5704fd83070 @kylemcdonald committed Feb 18, 2012
Showing with 35 additions and 15 deletions.
  1. +5 −0 FaceOSC/bin/data/settings.xml
  2. +7 −3 FaceOSC/bin/readme.txt
  3. +21 −12 FaceOSC/src/testApp.cpp
  4. +2 −0 FaceOSC/src/testApp.h
@@ -35,6 +35,11 @@
<!-- <clamp>3</clamp> -->
<!-- <tolerance>.01</tolerance> -->
<!-- <attempts>1</attempts> -->
+ <!--
+ drawMesh is a bool, 0 or 1
+ 1 by default
+ -->
+ <!-- <drawMesh>1</drawMesh> -->
</face>
<!-- osc output settings -->
View
@@ -17,7 +17,11 @@ Put the movie file in your home folder and set it in the movie <filename> tag wi
Change the source <useCamera> tag to 0 to use the movie as input. Also check the other movie settings (volume, speed).
-Key controls:
-* p - pause/unpause
-* up/down - increase/decrease movie playback speed
+Key Controls
+-------------
+
+* r - reset the face tracker
+* m - toggle face mesh drawing
+* p - pause/unpause (only works with movie source)
+* up/down - increase/decrease movie playback speed (only orks with movie source)
View
@@ -78,6 +78,10 @@ void testApp::loadSettings() {
if(xml.getNumTags("attempts")) {
tracker.setAttempts(xml.getValue("attempts", 1));
}
+ bDrawMesh = true;
+ if(xml.getNumTags("drawMesh")) {
+ bDrawMesh = (bool) xml.getValue("drawMesh", 1);
+ }
tracker.setup();
xml.popTag();
@@ -186,18 +190,20 @@ void testApp::draw() {
if(tracker.getFound()) {
ofDrawBitmapString(ofToString((int) ofGetFrameRate()), 10, 20);
- ofSetLineWidth(1);
- //tracker.draw();
- tracker.getImageMesh().drawWireframe();
-
- ofPushView();
- ofSetupScreenOrtho(sourceWidth, sourceHeight, OF_ORIENTATION_UNKNOWN, true, -1000, 1000);
- ofVec2f pos = tracker.getPosition();
- ofTranslate(pos.x, pos.y);
- applyMatrix(rotationMatrix);
- ofScale(10,10,10);
- ofDrawAxis(scale);
- ofPopView();
+ if(bDrawMesh) {
+ ofSetLineWidth(1);
+ //tracker.draw();
+ tracker.getImageMesh().drawWireframe();
+
+ ofPushView();
+ ofSetupScreenOrtho(sourceWidth, sourceHeight, OF_ORIENTATION_UNKNOWN, true, -1000, 1000);
+ ofVec2f pos = tracker.getPosition();
+ ofTranslate(pos.x, pos.y);
+ applyMatrix(rotationMatrix);
+ ofScale(10,10,10);
+ ofDrawAxis(scale);
+ ofPopView();
+ }
} else {
ofDrawBitmapString("searching for face...", 10, 20);
}
@@ -218,6 +224,9 @@ void testApp::keyPressed(int key) {
case 'r':
tracker.reset();
break;
+ case 'm':
+ bDrawMesh = !bDrawMesh;
+ break;
case 'p':
bPaused = !bPaused;
break;
View
@@ -41,4 +41,6 @@ class testApp : public ofBaseApp {
ofxFaceTracker tracker;
float scale;
ofMatrix4x4 rotationMatrix;
+
+ bool bDrawMesh;
};

0 comments on commit 642b564

Please sign in to comment.