three.js
JavaScript 3D library
The aim of the project is to create an easy to use, lightweight, 3D library with a default WebGL renderer. The library also provides Canvas 2D, SVG and CSS3D renderers in the examples.
Examples — Documentation — Wiki — Migrating — Questions — Forum — Slack — Discord
Usage
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.