How do I position text relative to a face in spark AR?

43 Views Asked by At

I'm trying to get the text which says "33" to be positioned at the same height as the users chin. You can see that I've successfully positioned planes to be at approximately the correct height (the redlines). But it's not working for the text, regardless of whether I transform the coordinate system using the face tracking module or not. What I doing wrong?

enter image description here

(async function () {  
    const face = FaceTracking.face(0)
 const topText = await Scene.root.findFirst('topText2')
  topText.transform.x = face.cameraTransform.applyToPoint(face.chin.tip).x 
  topText.transform.y = face.cameraTransform.applyToPoint(face.chin.tip).y 
})()
0

There are 0 best solutions below