Răsfoiți Sursa

Merge pull request #13146 from DonKarlssonSan/patch-1

Format according to official code style
Mr.doob 7 ani în urmă
părinte
comite
a885290f59
1 a modificat fișierele cu 12 adăugiri și 12 ștergeri
  1. 12 12
      docs/manual/introduction/Drawing-lines.html

+ 12 - 12
docs/manual/introduction/Drawing-lines.html

@@ -18,19 +18,19 @@
 			<p>Here is the code that we will use:</p>
 			<p>Here is the code that we will use:</p>
 			<code>
 			<code>
 var renderer = new THREE.WebGLRenderer();
 var renderer = new THREE.WebGLRenderer();
-renderer.setSize(window.innerWidth, window.innerHeight);
-document.body.appendChild(renderer.domElement);
+renderer.setSize( window.innerWidth, window.innerHeight );
+document.body.appendChild( renderer.domElement );
 
 
-var camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 500);
-camera.position.set(0, 0, 100);
-camera.lookAt(new THREE.Vector3(0, 0, 0));
+var camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 500 );
+camera.position.set( 0, 0, 100 );
+camera.lookAt( new THREE.Vector3( 0, 0, 0 ) );
 
 
 var scene = new THREE.Scene();
 var scene = new THREE.Scene();
 			</code>
 			</code>
 			<p>Next thing we will do is define a material. For lines we have to use [page:LineBasicMaterial] or [page:LineDashedMaterial].</p>
 			<p>Next thing we will do is define a material. For lines we have to use [page:LineBasicMaterial] or [page:LineDashedMaterial].</p>
 			<code>
 			<code>
 //create a blue LineBasicMaterial
 //create a blue LineBasicMaterial
-var material = new THREE.LineBasicMaterial({ color: 0x0000ff });
+var material = new THREE.LineBasicMaterial( { color: 0x0000ff } );
 			</code>
 			</code>
 
 
 			<p>
 			<p>
@@ -40,22 +40,22 @@ var material = new THREE.LineBasicMaterial({ color: 0x0000ff });
 
 
 			<code>
 			<code>
 var geometry = new THREE.Geometry();
 var geometry = new THREE.Geometry();
-geometry.vertices.push(new THREE.Vector3(-10, 0, 0));
-geometry.vertices.push(new THREE.Vector3(0, 10, 0));
-geometry.vertices.push(new THREE.Vector3(10, 0, 0));
+geometry.vertices.push(new THREE.Vector3( -10, 0, 0) );
+geometry.vertices.push(new THREE.Vector3( 0, 10, 0) );
+geometry.vertices.push(new THREE.Vector3( 10, 0, 0) );
 			</code>
 			</code>
 
 
 			<p>Note that lines are drawn between each consecutive pair of vertices, but not between the first and last (the line is not closed.)</p>
 			<p>Note that lines are drawn between each consecutive pair of vertices, but not between the first and last (the line is not closed.)</p>
 
 
 			<p>Now that we have points for two lines and a material, we can put them together to form a line.</p>
 			<p>Now that we have points for two lines and a material, we can put them together to form a line.</p>
 			<code>
 			<code>
-var line = new THREE.Line(geometry, material);
+var line = new THREE.Line( geometry, material );
 			</code>
 			</code>
 			<p>All that's left is to add it to the scene and call [page:WebGLRenderer.render render].</p>
 			<p>All that's left is to add it to the scene and call [page:WebGLRenderer.render render].</p>
 
 
 			<code>
 			<code>
-scene.add(line);
-renderer.render(scene, camera);
+scene.add( line );
+renderer.render( scene, camera );
 			</code>
 			</code>
 
 
 			<p>You should now be seeing an arrow pointing upwards, made from two blue lines.</p>
 			<p>You should now be seeing an arrow pointing upwards, made from two blue lines.</p>