0

I am trying to develop a filter where you have to eat elements in screen. My problem is that I cannot find the way to get the facemesh position and rotation in the world so that way I can compare the coordinates of facemesh with coordinates of the elements to eat. I try with worldtransform but allways returns 0 for my mesh. Is there any way to do that?

thanks so much

1 Answers1

1

I don't know your scene tree configuration. Assuming you have everything inside Focal Distance


const FaceTracking = require('FaceTracking');
const Scene = require('Scene');
const R = require('Reactive');

const face = FaceTracking.face(0);
const focalDistance = -Scene.root.find('Focal Distance').transform.z.pinLastValue();
const mouthFocal = face.cameraTransform.applyTo(face.mouth.center).add(R.point(0, 0, focalDistance));

Adding focalDistance to Z is for transformation from Camera space.

lisichka ggg
  • 563
  • 3
  • 15