1.0.5 • Published 6 years ago

@calvinscofield/three-loaders v1.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Usage

npm i @calvinscofield/three-loader -S
import { OBJLoader, MTLLoader } from '@calvinscofield/three-loaders'
new OBJLoader()
  .load('model/penlin.obj', (object) => {},
  (xhr) => {
    console.log((xhr.loaded / xhr.total * 100) + '% loaded')
  },
  (error) => {
	  console.log(error, 'An error happened')
  })

new THREE.MTLLoader()
  .setPath('models/obj/male02/')
  .load('lqfy.mtl', function (materials) {
    materials.preload()
    new THREE.OBJLoader()
      .setMaterials(materials)
      .setPath('models/obj/male02/')
      .load('lqfy.obj', (object) => { scene.add( object )},
      (xhr) => { console.log((xhr.loaded / xhr.total * 100) + '% loaded') },
      (error) => { console.log(error, 'An error happened') })
  })
1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago