whs.js

:rocket: 🌪 Super-fast 3D framework for Web Applications 🥇 & Games 🎮. Based on Three.js

component-driven · framework · high-performance · modular · physics
中级
GitHub在线演示
Stars:6,270
License:MIT License
更新:2025/12/26

README

Three Build Status

Community chat. Join us!

Discord

Table of content

New releases

whs is currently at v2 major version. We had plans for v3 yet but development isn't active. So v2 will probably remain the main stable version until further notice.

We try to publish minor update releases for bug fixes, we will review PRs.

NPM

# Install npm version
$ npm install whs

For [email protected] (Three.js r92) use @beta tag

# Install npm version
$ npm install whs@beta

NPM Version

Basic setup

Download the minified library or link the one from CDN

<script src="js/three.min.js"></script>
<script src="js/whs.min.js"></script>

The code below makes a WHS.App instance which handles all your modules and components for better work with WebGL. This one creates a scene, camera and renderer - we add the following modules to the App.

const app = new WHS.App([
  new WHS.ElementModule(), // Apply to DOM.
  new WHS.SceneModule(), // Create a new THREE.Scene and set it to app.

  new WHS.DefineModule('camera', new WHS.PerspectiveCamera({ // Apply a camera.
    position: new THREE.Vector3(0, 0, 50)
  })),

  new WHS.RenderingModule({bgColor: 0x162129}), // Apply THREE.WebGLRenderer
  new WHS.ResizeModule() // Make it resizable.
]);

app.start(); // Run app.

Featured projects

https://moxy.studio/ https://rmallick6806.github.io/SolarSystemBuilder/ http://www.tpain.com/ http://artifacts.zone/lorenzav/ http://artifacts.zone/tree/ http://abdaily.surge.sh/4/ http://abdaily.surge.sh/2/ http://abdaily.surge.sh/1/ http://theroguepixel.com/ http://supertiny.agency/ https://alexbuzin.me/ https://spatial.100shapes.com/ http://plateaux.space/

Features

  • 💎 Simple in usage
  • :rocket: Speeds up 3D scene prototyping
  • 🔌 Component based scene graph
  • 💣 Simple integration of any high performance physics even with Worker (Multithreading)
  • :dizzy: Automatization of rendering
  • 🆕 ES2015+ based
  • :large_blue_diamond: Extension system (modules)
  • :package: Webpack friendly
  • ✔️ Integrated Three.js rendering engine
  • :revolving_hearts: Work with whs.js and Three.js at the same time

External Modules

NameStatusDescription
physics-module-ammonextNPM VersionPhysics module based on Ammo.js

Donate

OpenCollective Backers OpenCollective Sponsors

Backers

Support us with a monthly donation and help us continue framework development🎉 and adding new features💡🎁.