Can I anchor a face tracker to a mesh?
I have a 3D model of a body, and a 3D model of a head. I want the head mesh to be anchored to a specific point on the body mesh. I want the face tracking(head binding) to only accept rotation and ignore positional tracking, so a user can control the direction that the head is looking, but not have any control of what the body mesh is doing.
Currently, I just have a 3D head floating around, mapped to the user's face rotation/position, with no anchor to the headless 3D body.
Is what I'm trying to do possible? I thought I saw a lens where the user can kind of rotate their head around as an orange, surrounded by other oranges. This may have just been a trick using various layer masks though.
-
Hi Tim,
The best way to achieve this effect is to separate your head mesh from the Head Binding object, and use a script to copy the rotation of the Head Binding object to the head mesh. Here's a breakdown of how to set that up:
- In the Objects panel, create a Head Binding object by selecting Add New -> Head Binding
- In the Resources Panel, create a new Script.
- Select your Head Mesh. In the Inspector, select Add Component -> Script
- On that new Script Component, select the Script you created in Step 2. In the dropdown, select Frame Updated.
- Open the Script resource you created and paste the following code:
//@input SceneObject rotationSource
if(script.rotationSource)
{
script.getSceneObject().getTransform().setWorldRotation(script.rotationSource.getTransform().getWorldRotation());
} - Select your Head Mesh object again. In the Inspector, set the "Rotation Source" object to your Head Binding object. This will copy the rotation from the Head Binding object and apply it to the Head Mesh every frame.
Let me know if these steps work for you!
Best,
Peter
Comment actions -
Thanks a bunch Peter. This worked exactly as expected, and I learned something new today!
Comment actions
Please sign in to leave a comment.
Have a comment?