Skip to content

broehl/avatars

This branch is 7 commits behind exokitxr/avatars:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Avaer Kazmer
Aug 8, 2020
4163a7e · Aug 8, 2020
Dec 12, 2019
Oct 22, 2019
Nov 14, 2019
Jun 18, 2020
Oct 22, 2019
Oct 26, 2019
Oct 26, 2019
Oct 25, 2019
Oct 22, 2019
Oct 31, 2019
Nov 23, 2019
Aug 8, 2020
Nov 1, 2019
Nov 20, 2019
Oct 26, 2019
Nov 6, 2019
Jan 3, 2020
Oct 22, 2019
Oct 25, 2019
Nov 14, 2019
Nov 14, 2019
Oct 22, 2019
Aug 8, 2020
Nov 16, 2019
Nov 23, 2019
Dec 10, 2019

Repository files navigation

Exokit Avatars

SiteDocsDiscordTwitterEmail List

Hands Reality Tab Live Reload Magic Leap Tutorial Reality Tab

The only web-based avatar system you need.

  • Loads GLB, FBX, VRChat, VRoid, .unitypackage humanoid
  • Auto-detects rigs, height, orientation
  • World scale matching
  • HMD + gamepads input
  • Bones orientation output
  • Arms, legs inverse kinematics
  • Walking kinematics
  • Face animation (visemes) with microphone
  • Hair/clothing animation

How it works

import './three.js';
import Avatar from 'https://avatars.exokit.org/avatars.js';

const avatar = new Avatar(model, { // model is THREE.Mesh, can use https://github.com/exokitxr/model-loader
  // all options are optional

  // animate fingers
  fingers: true,

  // animate hair
  hair: true,

  // remove head for first person
  decapitate: false,

  // animate visemes (blink, mouth, etc.)
  visemes: true,
  // navigator.mediaDevices.getUserMedia({audio: true}); // microphone input for visemes
  microphoneMediaStream,
  // false to passthrough microphone audio
  muted: true,

  // add debug bone geometry
  debug: true,
});

avatar.setMicrophoneMediaStream(microphoneMediaStream); // set microphoneMediaStream separately

function animate() {
  const now = Date.now();
  avatar.inputs.hmd.position.set(0, 1.5 + Math.sin((now%2000)/2000*Math.PI*2)*0.5, 0); // or, get pose from WebXR
  avatar.leftGamepad.hmd.position.copy(avatar.inputs.hmd.position).add(new THREE.Vector3(0.2, -0.3, -0.3));
  avatar.leftGamepad.pointer = 0.5; // for finger animation
  avatar.leftGamepad.grip = 1;
  avatar.rightGamepad.hmd.position.copy(avatar.inputs.hmd.position).add(new THREE.Vector3(-0.2, -0.3, -0.3));

  avatar.update();

  requestAnimationFrame(animate);
}
animate();

About

Avatar system for Exokit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.7%
  • HTML 2.3%