vue加载obj插件
程序员文章站
2022-03-26 16:01:06
...
install
npm i --save three-obj-mtl-loader
usage
import * as THREE from 'three'
import {MTLLoader, OBJLoader} from '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)
})
})
上一篇: jQuery数组中是否存在指定值
下一篇: 深入了解Python数据类型之列表