|
@@ -17,12 +17,12 @@ Alternatively see [how to build the library yourself](https://github.com/mrdoob/
|
|
|
<script src="js/three.min.js"></script>
|
|
|
```
|
|
|
|
|
|
-This code creates a scene, then creates a camera, adds the camera and cube to the scene, creates a <canvas> renderer and adds its viewport in the document.body element.
|
|
|
+This code creates a scene, a camera, and a geometric cube, and it adds the cube to the scene. It then creates a <canvas> 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.
|
|
|
|
|
|
```html
|
|
|
<script>
|
|
|
|
|
|
- var camera, scene, renderer;
|
|
|
+ var scene, camera, renderer;
|
|
|
var geometry, material, mesh;
|
|
|
|
|
|
init();
|
|
@@ -30,15 +30,15 @@ This code creates a scene, then creates a camera, adds the camera and cube to th
|
|
|
|
|
|
function init() {
|
|
|
|
|
|
+ scene = new THREE.Scene();
|
|
|
+
|
|
|
camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 );
|
|
|
camera.position.z = 1000;
|
|
|
|
|
|
- scene = new THREE.Scene();
|
|
|
-
|
|
|
geometry = new THREE.BoxGeometry( 200, 200, 200 );
|
|
|
material = new THREE.MeshBasicMaterial( { color: 0xff0000, wireframe: true } );
|
|
|
-
|
|
|
mesh = new THREE.Mesh( geometry, material );
|
|
|
+
|
|
|
scene.add( mesh );
|
|
|
|
|
|
renderer = new THREE.CanvasRenderer();
|