The aim of the project is to create a lightweight 3D library with a very low level of complexity — in other words, for dummies. The library provides <canvas>, <svg>, CSS3D and WebGL renderers.
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 scene camera renderer;var geometry material mesh;init;animate;scene = ;camera = 75 windowinnerWidth / windowinnerHeight 1 10000 ;camerapositionz = 1000;geometry = 200 200 200 ;material = color: 0xff0000 wireframe: true ;mesh = geometry material ;sceneadd mesh ;renderer = ;renderersetSize windowinnerWidth windowinnerHeight ;documentbodyappendChild rendererdomElement ;requestAnimationFrame animate ;meshrotationx += 0.01;meshrotationy += 0.02;rendererrender scene camera ;
If everything went well you should see this.