Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/exokitxr/avatars
Avatar system for Exokit
https://github.com/exokitxr/avatars
Last synced: 14 days ago
JSON representation
Avatar system for Exokit
- Host: GitHub
- URL: https://github.com/exokitxr/avatars
- Owner: exokitxr
- Created: 2019-10-22T21:10:46.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-07T00:38:37.000Z (over 1 year ago)
- Last Synced: 2024-11-14T04:34:28.205Z (28 days ago)
- Language: JavaScript
- Homepage: https://avatars.exokit.org
- Size: 297 MB
- Stars: 71
- Watchers: 8
- Forks: 28
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-webxr - Exokit Avatars - A web-based avatar system that can load humanoid avatars in multiple different model formats and features arm+leg IK, facial animation via visemes, and more. The original repo is no longer maintained, but there is a more up-to-date fork available [here](https://github.com/msub2/avatars). (Avatars)
README
# Exokit Avatars
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 the gltf object that includes the scene, 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.inputs.leftGamepad.position.copy(avatar.inputs.hmd.position).add(new THREE.Vector3(0.2, -0.3, -0.3));
avatar.inputs.leftGamepad.pointer = 0.5; // for finger animation
avatar.inputs.leftGamepad.grip = 1;
avatar.inputs.rightGamepad.position.copy(avatar.inputs.hmd.position).add(new THREE.Vector3(-0.2, -0.3, -0.3));avatar.setFloorHeight(0) // sets the floor height that exokit uses to determine the pose
avatar.update();
requestAnimationFrame(animate);
}
animate();
```## [License](https://github.com/exokitxr/license)