Przeglądaj źródła

Merge pull request #4696 from janaspage/patch-1

Rewording of demo-code narrative.
Mr.doob 11 lat temu
rodzic
commit
223f46bd46
1 zmienionych plików z 5 dodań i 5 usunięć
  1. 5 5
      README.md

+ 5 - 5
README.md

@@ -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 &lt;canvas&gt; 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 &lt;canvas&gt; 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();