three-sixty

0.0.2 • Public • Published

ThreeSixty

A ThreeJS extension for taking equirectangular screenshots of a scene

Example

Basic Example

Usage

    
    var file = threeSixty({
        renderer: renderer,
        scene: scene
    });

    // open image in the browser
    file.open();

    // save/download image
    file.save();

    // use image as a texture
    var image = new Image();
    var texture = new THREE.Texture(image);
    image.onload = function () {
        texture.needsUpdate = true;
    }
    image.src = file.data;

    // upload to your server
    myScreenshotUploader(file.data);

Options

    var options = {
        width: 2048,                    // the width of the screenshot
        height: 1024,                   // the height of the screenshot
        renderer: renderer,             // your WebGLRenderer
        scene: scene,                   // your scene
        position: new THREE.Vector3(),  // the position of the screenshot
        rotation: new THREE.Euler(),    // the rotation of the screenshot
    }

    var file = threeSixty(options);

Package Sidebar

Install

npm i three-sixty

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • ashconnell