All Projects → rdrgn → three-vrm

rdrgn / three-vrm

Licence: MIT license
⚠️ [deprecated] VRM file loader for three.js

Programming Languages

typescript
32286 projects
GLSL
2045 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to three-vrm

PolyDraw
✳️ PTSource PolyDraw is a free 3D polygonal modeller for Windows x86 and x64, for creating or modifying 3D objects using a mesh of 3D points and parametric NURBS Curves .Exports and imports to over 40 formats including WebVR and 3D Printing.
Stars: ✭ 17 (-61.36%)
Mutual labels:  threejs, vrm
three-orbitcontrols
is the three.js OrbitControls from official repo examples
Stars: ✭ 80 (+81.82%)
Mutual labels:  threejs
Photo-Sphere-Viewer
A JavaScript library to display Photo Sphere panoramas.
Stars: ✭ 1,198 (+2622.73%)
Mutual labels:  threejs
three-musketeers
A simple module to introspect, debug and test any THREE.js application.
Stars: ✭ 30 (-31.82%)
Mutual labels:  threejs
three-to-cannon
Convert a THREE.Mesh to a CANNON.Shape.
Stars: ✭ 207 (+370.45%)
Mutual labels:  threejs
potree-core
Potree point cloud viewer library core components for easier integration in a three.js project.
Stars: ✭ 88 (+100%)
Mutual labels:  threejs
Big-Data-Demo
基于Vue、three.js、echarts,数据可视化展示项目,包含三维模型导入交互、三维模型标注等功能
Stars: ✭ 146 (+231.82%)
Mutual labels:  threejs
THREE.WebGPURenderer
Experimental Three.js WebGPU renderer
Stars: ✭ 117 (+165.91%)
Mutual labels:  threejs
three-jsm
Minimal three.js project setup using ES6 modules and rollup.
Stars: ✭ 74 (+68.18%)
Mutual labels:  threejs
three-plain-animator
Three-Plain-Animator is a package for threejs developers to support 2D animations.
Stars: ✭ 56 (+27.27%)
Mutual labels:  threejs
vuletube
Starter project for vue in combination with typescript. Getting response for youtube search. Call server part for saving videos. Use videos in three.js 3d port view. Control vuletube site with hands (NUI) also with voice command.
Stars: ✭ 12 (-72.73%)
Mutual labels:  threejs
generative
Creative coding experiments
Stars: ✭ 71 (+61.36%)
Mutual labels:  threejs
three-kt-wrapper
Kotlin wrappers for Three.js
Stars: ✭ 46 (+4.55%)
Mutual labels:  threejs
three-mithril-ts
THREE.js, Mithril.js, TypeScript starter project
Stars: ✭ 34 (-22.73%)
Mutual labels:  threejs
three.wasm-experimental
Experimental Three.js WASM (WIP)
Stars: ✭ 51 (+15.91%)
Mutual labels:  threejs
WebGL-Billiards
ThreeJS based 8-ball pool
Stars: ✭ 28 (-36.36%)
Mutual labels:  threejs
vrm pp
Small C++ preprocessor library
Stars: ✭ 12 (-72.73%)
Mutual labels:  vrm
threejs-dem-visualizer
Visualizing ASTER and LANDSAT satellite data using THREE.js
Stars: ✭ 35 (-20.45%)
Mutual labels:  threejs
babylon-vrm-loader
glTF VRM extension Loader for babylon.js
Stars: ✭ 77 (+75%)
Mutual labels:  vrm
voxelizer
👾 Voxelization of 3D models
Stars: ✭ 32 (-27.27%)
Mutual labels:  threejs

[deprecated] three-vrm

This package is deprecated. Use @pixiv/three-vrm instead. (@pixiv/three-vrm is NOT our product and it is NOT compatible with this package.)

本パッケージは開発を停止しています。 @pixiv/three-vrmを使用してください。 (本パッケージとは開発者が異なり、互換性がありません。)

VRM file loader and utilities for three.js, written in TypeScript.

VRM 形式の 3D モデルを three.js で描画するためのパッケージです。

Dependencies

yarn add three

Usage

Install the package from npm and import it.

yarn add three-vrm

This TypeScript code loads a VRM file with VRMLoader. You have to create a Camera, a Light, and a WebGLRenderer to render the Scene. See the usage of three.js.

import * as THREE from 'three';
import { VRM, VRMLoader } from 'three-vrm';

const scene = new THREE.Scene();

const vrmLoader = new VRMLoader();

vrmLoader.load(
  'model.vrm',
  (vrm: VRM) => {
    scene.add(vrm.model);
    // Render the scene.
  },
  (progress: ProgressEvent) => {
    console.log(progress.loaded / progress.total);
  },
  (error: ErrorEvent) => {
    console.error(error);
  }
);

Alternatively, if you work with HTML and a copy of three.js, you may copy only node_modules/three-vrm/lib/index.js and include it. Rename the file as necessary. This file assigns all exported classes to THREE.

<script src="js/three.js"></script>
<script src="js/three-vrm.js"></script>
<script>
  var scene = new THREE.Scene();

  var vrmLoader = new THREE.VRMLoader();

  vrmLoader.load(
    'model.vrm',
    function(vrm) {
      scene.add(vrm.model);
      // Render the scene.
    },
    function(progress) {
      console.log(progress.loaded / progress.total);
    },
    function(error) {
      console.error(error);
    }
  );
</script>

VRMLoader

A loader for VRM resources.

new VRMLoader ( manager? : THREE.LoadingManager )

Creates a new VRMLoader.

.load ( url : string, onLoad? : Function, onProgress? : Function, onError? : Function ) : void

Loads a VRM model.

VRM

Model data loaded by VRMLoader.

.asset : object

A glTF asset property.

.model : THREE.Object3D

A Object3D.

.parser : object

A GLTFParser created by GLTFLoader.

.userData : object

A dictionary object with extension data. Raw json of VRM extensions is in .userData.gltfExtensions.VRM.

.materialProperties : Array

An array of VRM material properties.

.humanoid : object

VRM bone mapping.

.meta : object

VRM model information.

.blendShapeMaster : object

VRM blendShapeMaster with an array of BlendShapeGroups to group BlendShape.

.firstPerson : object

VRM first-person settings.

.secondaryAnimation : object

VRM swaying object settings.

.getNode ( index : number ) : THREE.Object3D

Returns a reference to the Object3D in .model, corresponding to the node index.

.setBlendShapeWeight ( meshIndex : number, blendShapeIndex : number, value : number ) : void

Morphs the mesh.

.setBlendShapeGroupWeight ( index : number, value : number ) : void

Morphs all meshes in the BlendShapeGroup.

VRMPhysics

A Physics handler for VRM.

const clock = new THREE.Clock();
const physics = new VRMPhysics(vrm);

function render() {
  const delta = clock.getDelta();
  physics.update(delta);
  renderer.render(scene, camera);
}

new VRMPhysics ( vrm : VRM )

Creates a new VRMPhysics.

.update ( deltaTime : number ) : VRMPhysics

deltaTime - Time in second.

Advances Physics calculation and updates bones.

Development

yarn
yarn start

Open localhost:8080 with a browser.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].