0.0.2 • Published 8 years ago

three-sixty v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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