0.1.2 • Published 5 years ago

webviewer-uploader v0.1.2

Weekly downloads
-
License
-
Repository
-
Last release
5 years ago

Usage

Include file

<script type="text/javascript" src="https://ar-ty.fra1.cdn.digitaloceanspaces.com/webviewer/uploader.js"/>

Add container for uploader

<div class="uploader-container" id="model-uploader"></div>

Initialize

modelUploader.init('https://path/to/post', configObject, () => {
    console.log("On model uploaded");
});

Config object params

All configs are optional

configObject = {
    //  Web viewer section id
    containerId: 'webViewerContainer', 

    // Model auto rotation
    autoRotate: true,

    // Speed of auto rotation
    autoRotateSpeed: 10,

    // Should model cast shadows
    castShadow: true,

    // Background color
    backgroundColor: '#ffffff',

    // Allow users to zoom in and zoom out on model
    zoomEnabled: true,

    // How close can user zoom in a model
    minZoom: 1,

    // How far can user zoom out a model
    maxZoom: 10,

    // Top rotation limit
    rotationPolarTopLimit: 100,

    // Bottom rotation limit
    rotationPolarBottomLimit: 100,

    // Route to hdri files
    hdrisLocation: null,

    // Name of hdri file
    hdriName: null
}

Upload

modelUploader.uploadModel();