jjw-three-obj-mtl-loader137
v1.0.0
Published
适配threejs 137
Downloads
2
Readme
three-obj-mtl-loader
THREE.OBJLoader repackaged as a node module
install
npm i --save @hbis/three-obj-mtl-loader
usage
import * as THREE from 'three'
import {MTLLoader, OBJLoader} from '@hbis/three-obj-mtl-loader'
let scene = new THREE.Scene()
let mtlLoader = new MTLLoader();
let objLoader = new OBJLoader();
mtlLoader.load('./test.mtl', (materials) => {
materials.preload()
objLoader.setMaterials(materials)
objLoader.load('./test.obj', (object) => {
scene.add(object)
})
})