WhitestormJS
![]() | |
Original author(s) | Alexander Buzin (sasha240100) [1] |
---|---|
Developer(s) | WhitestormJS community [2] |
Stable release | v0.0.7 / February 4, 2016 |
Development status | Active |
Written in | JavaScript |
Type | JavaScript library |
License | CC[3] |
Website |
whitestormjs |
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]
- Multi-platform support
- Multithread (WebWorkers)
- Optimized graphics. Up to x1.5 times
- Terrain generation script.
- JSON-type object crafting.
- Open source on GitHub.
- 10+ post-effects powered by Wagner
- Plugin support.
- Wrapping for helpers, controls, basic objects
Whitestorm.js uses WebGL.
Whitestorm.js is made available under the CC license.[3]
Usage
- It is advised to download your own copies of the following libraries, as large changes can break backwards compatibility.
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

- API - small functions.
- Init() - main. Scene/world initialization.
- Objects
- Ground
- Post-Effects
- Fog
- Light
- Controls
References
- ↑ https://github.com/WhitestormJS
- 1 2 Creative commons license
- ↑ sasha240100. "Features".
External links
- WhitestormJS - Three.js Based Game Engine - Interview with Alexander Buzin
- Documetation
- Github repository.
- Issues.
- Examples
- Blog
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