Giter Site home page Giter Site logo

giastfader / whitestorm.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from whitestormjs/whs.js

0.0 2.0 0.0 249.86 MB

:rocket: Framework for developing 3D web apps with physics.

Home Page: https://whsjs.io/

License: MIT License

JavaScript 99.79% HTML 0.21%

whitestorm.js's Introduction

logo

XO code style NPM Version Build Status Known Vulnerabilities Discord

Framework for developing 3D web apps

You can find lots of examples at showcases.

basic/helloworld basic/model softbody/cloth3 postprocessing/basic-glitch softbody/ropes design/saturn

Why?

  • ๐Ÿค” Because making of even a basic Three.js application requires at least ~20 lines of code (see this tutorial)

    • Native three.js: you will need to setup: scene, renderer, camera, make an animate() function before making the actual app.
    • Whitestorm.js: all those values are filled with defaults, you just need to define your own values only if they differs from defauts.
  • ๐Ÿ’ฃ Adding physics is hard.

    • Other frameworks: To make your app run with physics you need to make a second world with same 3d objects and apply their transform (position & rotation) to your rendered scene objects (THREE.Scene for example) in every frame.
    • Whitestorm.js: All this can be done automatically.
  • ๐Ÿ”Œ Components & plugins

    • Other: Unknown yet.
    • Whitestorm.js: It provides ability to create your own components using framework's tools. (You can add a component like WHS.Box or WHS.PointLight but for creating a terrain (WHS.Terrain) / aquarium (WHS.Aquarium) / car (WHS.Car) / any other with specific merhods and scripts.
    • See Component system in interactive 3D of web article for more info.

Features

  • ๐Ÿ’Ž Simple in usage
  • Minimize 3D scene prototyping
  • ๐Ÿ”Œ Component based scene graph
  • ๐Ÿ’ฃ Integrated high performance physics with Worker (Multithreading)
  • Automatization of rendering
  • Enhanced softbodies
  • ๐Ÿ†• ES2015+ based
  • Extension system (plugins)
  • Dynamic geometry update
  • asm.js acceleration
  • Webpack friendly
  • โœ”๏ธ Integrated Three.js rendering engine
  • Work with Whitestorm.js and Three.js at the same time

Installation

NODE

$ npm install --save whs

WEBPACK

See WhitestormJS/test-whitestorm-webpack for more details.

Documentation

Full documentation of guides and APIs are located at here.

Usage

const world = new WHS.World({
    stats: "fps", // fps, ms, mb or false if not need.
    autoresize: "window",

    gravity: [0, -100, 0], // Physic gravity.

    camera: {
      position: {
        z: 50 // Move camera.
      }
    }
});

const sphere = new WHS.Sphere({ // Create sphere comonent.
  geometry: {
    radius: 3
  },

  mass: 10, // Mass of physics object.

  material: {
    color: 0xffffff, // White color.
    kind: 'basic' // THREE.MeshBasicMaterial
  },

  position: [0, 10, 0]
});

sphere.addTo(world);
console.log(sphere.native); // Returns THREE.Mesh of this object.

world.start(); // Start animations and physics simulation.

Playground!

playground

Contributors

Author Contributor Contributor Contributor Contributor Contributor Contributor Contributor Contributor

forthebadge

whitestorm.js's People

Contributors

sasha240100 avatar jackdalton2 avatar preco21 avatar noctisdark avatar typedef42 avatar jackdalton avatar electron0zero avatar taro-0 avatar bdirl avatar yeliex avatar brunocascio avatar t4r0 avatar timoxley avatar zlatanvasovic avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.