threejs-model-loader-wrapper

1.0.9 • Public • Published

threejs-model-loader-wrapper

David

Simple wrapper for three.js OBJ model loader

Usage

 <div id="main" style="width: 800px; height: 600px;"></div>
 <script src="dist/index.js"></script>
 <script>
     window.load3D(
             document.getElementById('main'),
             {
                 cameraX: 100,
                 cameraY: 100,
                 cameraZ: 200,
                 ambientLight: 0x555555,
                 directionalLight: 0x888888,
                 ambientLightStrength: 1,
                 directionalLightStrength: 1.5,
             },
             [
                 {
                     options: {
                         x: 50,
                         y: 50,
                         z: 0,
                         scale: 50,
                         rotateX: 0,
                         rotateY: 45,
                         rotateZ: 0
                     },
                     model: 'example/cube.obj',
                     material: 'example/cube.mtl',
                     texture: 'example/cube.jpg'
                 },
                 {
                     options: {x: -50, scale: 30},
                     model: 'example/cube.obj',
                     texture: 'example/cube.jpg'
                 }
             ]
     );
 
 </script>

Development

npm start - run example

npm build - build

npm test - run eslint

License

threejs-model-loader-wrapper is licensed under the MIT license. For the full license, see the LICENSE file.

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i threejs-model-loader-wrapper

    Weekly Downloads

    0

    Version

    1.0.9

    License

    MIT

    Unpacked Size

    657 kB

    Total Files

    13

    Last publish

    Collaborators

    • adamnowocin