WhitestormJS

Whitestorm.js
Original author(s) Alexander Buzin (sasha240100) [1]
Developer(s) WhitestormJS community [2]
Stable release v0.0.7 / February 4, 2016 (2016-02-04)
Development status Active
Written in JavaScript
Type JavaScript library
License CC[3]
Website whitestormjs.xyz

Whitestorm.js is a 3D JavaScript library/API based on Three.js that simplify code, adds physics and post-effects. The source code is hosted in a repository on GitHub.

Overview

Whitestorm.js offers API for simple functions like autoresizing, helpers and post-effects and for advanced like terrain generation script, plugin support etc. It's a wrapper around visualization by Three.js and physics by Physi.js.

Engine execute animation after world initialization. Each frame position and rotation from physics object applies to its clones in Three.js. Data for both objects is stored in scope of WHS object. Structure of engine is very simple and consist of sub-functions for WHS.init()

Features

Whitestorm.js includes the following features:[4]

Whitestorm.js uses WebGL.

Whitestorm.js is made available under the CC license.[3]

Usage

The Whitestorm.js library is a single JavaScript file. Include Three.js, Wagner, and Cannon.js libraries before Whitestorm.js. Include a script tag linking the WhitestormJS library in your head or after your body:

<script src="three.js"></script>
<script src="cannon.js"></script>
<script src="wagner.js"></script>
<!-- WhitestormJS library -->
<script src="{path_to_lib}/whitestorm.js"></script>

After adding these libraries, you can configure your game:

var GAME = new WHS.init({
    anaglyph: false, // Anaglyph effect.
    helper: false, // Cannon.js shape helper
    stats: "fps", // fps, ms, mb or false if not need.
    wagner: WAGNER, // wagner library variable
    gravity: { // Physic gravity.
        x: 0,
        y: -200,
        z: 0
    }
});

GAME.sphere = GAME.addObject("sphere",
{
    geometryOptions: {
        radius:3 // Sphere radius
    },
    mass: 10, // Mass for CANNON.JS
    onlyvis: false, // If set true - no physic for this object
    materialOptions: { // ThreeJs material options
        color: 0xffffff,
        type: "basic"
    },
    pos: { // position in space
        x: 0,
        y: 100,
        z: 0
    }
});

Structure

References

External links

Category:2010 software Category:3D scenegraph APIs Category:Cross-platform software Category:Free 3D graphics software Category:Graphics libraries Category:JavaScript libraries Category:Software using the MIT license Category:WebGL

This article is issued from Wikipedia - version of the Saturday, April 16, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.