Use MMD on Three.js
MMDLoader
having been removed in three.js r172 nearly ten months ago,
and no code has ever appeared in the takahirox/three-mmd-loader repository.
Considering the needs of Project AIRI or other future projects, I decided to fork and maintain it, i.e., this repo.
- Rapier-based physics (help wanted)
- WebGPURenderer compatibility
npm i three @moeru/three-mmd
npm i -D @types/three
There may be significant changes in future versions, so this is unstable.
import { MMDLoader } from '@moeru/three-mmd'
import { Scene } from 'three'
const scene = new Scene()
const loader = new MMDLoader()
loader.load(
// URL of the model you want to load
'/models/miku_v2.pmd',
// called when the resource is loaded
mesh => scene.add(mesh),
// called while loading is progressing
progress => console.log('Loading model...', 100.0 * (progress.loaded / progress.total), '%'),
// called when loading has errors
error => console.error(error),
)
This project is based on the code from three.js and three-ts-types r171.