Created
September 19, 2019 11:00
-
-
Save kamend/b1538d5a5fbe036b15ab71a946fc7221 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to load in modules | |
const FaceTracking = require('FaceTracking'); | |
const D = require('Diagnostics'); | |
const Scene = require('Scene'); | |
const TouchGestures = require('TouchGestures'); | |
const object = Scene.root.find("object"); | |
face.mouth.openness.monitor().subscribe(function(event) { | |
if(event.newValue > 0) { | |
object.transform.x = FaceTracking.face(0).cameraTransform.applyTo(FaceTracking.face(0).mouth.center).x; | |
object.transform.y = FaceTracking.face(0).cameraTransform.applyTo(FaceTracking.face(0).mouth.center).y; | |
object.transform.z = FaceTracking.face(0).cameraTransform.applyTo(FaceTracking.face(0).mouth.center).z; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment