three-obj-mtl-loader

Threejs newest obj&mtl loader with npm dev

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
three-obj-mtl-loader
15101.0.36 years ago6 years agoMinified + gzip package size for three-obj-mtl-loader in KB

Readme

three-obj-mtl-loader

THREE.OBJLoader repackaged as a node module

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)
  })
})