Skip to content

Latest commit

 

History

History

mson-three

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

mson-three

This package is used to load Mson models and create Three.js objects from them.

Installation

npm install three @keupoz/mson-three

Usage

import { ThreeMsonLoader } from '@keupoz/mson-three'
import { LoadingManager, Scene } from 'three'

const loadingManager = new LoadingManager()

loadingManager.setURLModifier((modelId) => {
  const [namespace, path] = modelId.split(':')

  return `path/to/${namespace}/models/${path}`
})

const msonLoader = new ThreeMsonLoader(loadingManager)
const model = await msonLoader.loadAsync('mson:steve')
const scene = new Scene()

scene.add(model)