Socket
Book a DemoInstallSign in
Socket

gl-disjoint-skybox

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gl-disjoint-skybox

Draws a disjoint skybox into a 3D scene.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

gl-disjoint-skybox

Draws a disjoint skybox into a 3D scene.

Install

npm install gl-disjoint-skybox

Example

var debugCubemap = require('gl-cubemap-placeholder');
var createSkybox = require('gl-disjoint-skybox');

var textures = debugCubemap(gl);
var skybox = createSkybox(gl, textures);

var view = mat4.create();
var projection = mat4.create();

mat4.lookAt(view, [0,0,0], [0,0,-1], [0,1,0]);
mat4.perspective(projection, Math.PI/2, width/height, 0.1, 10.0);

skybox.draw({
    view: view,
    projection: projection
});

API

var createSkybox = require('gl-disjoint-skybox');

Constructor

var skybox = createSkybox(gl, textures)

Returns a skybox object ready for rendering.

Takes a WebGL context gl and a disjoint cubemap textures structured so:

{
    pos: {
        x: gl-texture2d texture,
        y: gl-texture2d texture,
        z: gl-texture2d texture
    },
    neg: {
        x: gl-texture2d texture,
        y: gl-texture2d texture,
        z: gl-texture2d texture
    }
}

See gl-texture2d for more information about the required texture objects.

Methods

skybox.draw(camera)

Takes an object camera that has view and projection fields defined:

{
    view: gl-mat4 view matrix,
    projection: gl-mat4 projection matrix
}

FAQs

Package last updated on 01 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts