Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kamend/b1538d5a5fbe036b15ab71a946fc7221 to your computer and use it in GitHub Desktop.
Save kamend/b1538d5a5fbe036b15ab71a946fc7221 to your computer and use it in GitHub Desktop.
// 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