three.js
JavaScript 3D library
The aim of the project is to create an easy to use, lightweight, 3D library. The library provides Canvas 2D, SVG, CSS3D and WebGL renderers.
Examples — Documentation — Wiki — Migrating — Questions — Forum — Gitter — Slack
Usage
Download the minified library and include it in your HTML, or install and import it as a module, Alternatively see how to build the library yourself.
This code creates a scene, a camera, and a geometric cube, and it adds the cube to the scene. It then creates a WebGL
renderer for the scene and camera, and it adds that viewport to the document.body element. Finally, it animates the cube within the scene for the camera.
var camera scene renderer;var geometry material mesh; ;; { camera = 70 windowinnerWidth / windowinnerHeight 001 10 ; camerapositionz = 1; scene = ; geometry = 02 02 02 ; material = ; mesh = geometry material ; scene; renderer = antialias: true ; renderer; documentbody; } { ; meshrotationx += 001; meshrotationy += 002; renderer; }
If everything went well you should see this.