νλ‘μ νΈ
GitHubμμ 보기
moeru-ai/three-mmd
μκ°
π₯¬π Use MMD on Three.js
μ°½μ λ° λ―Έλμ΄μΈ‘μ λ μ€ν μ¦κ°
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- κΈ°λ‘ μμ§ μ€
μλ‘ κ²ΉμΉλ κΈ°κ°μ μμ¦κ°λμ΄λ©° μΌλ³ ν©κ³κ° μλλλ€. μΈ‘μ κ°μ΄ μμΌλ©΄ λΉμ λ‘λλ€. μ€νλ κ΄μ¬λλ₯Ό λνλ΄λ©° νμ§μ 보μ₯νμ§ μμ΅λλ€.
README.md
Original@moeru/three-mmd
Use MMD on Three.js
Packages
@moeru/three-mmdβ core runtime and opt-in WebGL toon/physical materials@moeru/three-mmd-physics-ammoβ Ammo.js physics@moeru/three-mmd-physics-springboneβ spring bone physics
Install
pnpm add three @moeru/three-mmd
pnpm add -D @types/three
Basic usage
import { buildAnimation, MMDLoader, VMDLoader } from '@moeru/three-mmd'
import { AnimationMixer, Timer } from 'three'
const mmd = await new MMDLoader().loadAsync('/models/miku_v2.pmd')
const vmd = await new VMDLoader().loadAsync('/motions/wavefile_v2.vmd')
const mixer = new AnimationMixer(mmd.mesh)
const timer = new Timer()
mixer.clipAction(buildAnimation(vmd, mmd.mesh)).play()
// Call this once per render frame.
const update = () =>
mmd.updateWithMixer(timer.getDelta(), mixer)
updateWithMixer() restores the previous animation pose, advances the mixer,
then applies MMD IK, grants, and the optional physics service. Use update()
directly when the mixer is managed elsewhere; do not call both methods for the
same frame.
Physics
Physics is provided by separate packages. Register one plugin before loading the model:
import { MMDLoader } from '@moeru/three-mmd'
import { MMDAmmoPlugin } from '@moeru/three-mmd-physics-ammo'
const mmd = await new MMDLoader()
.register(MMDAmmoPlugin)
.loadAsync('/models/miku_v2.pmd')
The default material backend is the WebGL MMDToonMaterial.
See also
License
This project is based on the code from babylon-mmd, three.js and three-ts-types r171.
Sponsors
κ΄λ ¨ νλ‘μ νΈ μ΄ν΄λ³΄κΈ°
λΆλ¬μ€λ μ€β¦