Skip to content

Eye tracking #1129

Answered by ke456-png
ALABOET asked this question in Help
Dec 9, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

To make the avatar's eyes always look at the camera, use "vrm.lookAt.target = camera" as you said.

const vrm = gltf.userData.vrm;
vrm.lookAt.target = camera;

// Render loop
function animate() {
  requestAnimationFrame( animate );
  const deltaTime = clock.getDelta();
  if ( currentVrm ) {
    // Need update vrm
    currentVrm.update( deltaTime );
  }
  renderer.render( scene, camera );
}
animate();

Here is the API reference for that.
https://pixiv.github.io/three-vrm/packages/three-vrm/docs/classes/VRMLookAt.html#target

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ALABOET
Comment options

Answer selected by ALABOET
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants