提交 4205deff 编写于 作者: N nipher

Improve introduction doc fixing small scope issues

Small issues:
- Missing `var` keywords
- Multiple left-hand assignments declaring global variables, more info: http://stackoverflow.com/questions/1758576/multiple-left-hand-assignment-with-javascript
上级 6ab595c8
...@@ -69,14 +69,14 @@ var positions = new Float32Array( MAX_POINTS * 3 ); // 3 vertices per point ...@@ -69,14 +69,14 @@ var positions = new Float32Array( MAX_POINTS * 3 ); // 3 vertices per point
geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) ); geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
// draw range // draw range
drawCount = 2; // draw the first 2 points, only var drawCount = 2; // draw the first 2 points, only
geometry.setDrawRange( 0, drawCount ); geometry.setDrawRange( 0, drawCount );
// material // material
var material = new THREE.LineBasicMaterial( { color: 0xff0000, linewidth: 2 } ); var material = new THREE.LineBasicMaterial( { color: 0xff0000, linewidth: 2 } );
// line // line
line = new THREE.Line( geometry, material ); var line = new THREE.Line( geometry, material );
scene.add( line ); scene.add( line );
</code> </code>
<p> <p>
...@@ -85,7 +85,8 @@ scene.add( line ); ...@@ -85,7 +85,8 @@ scene.add( line );
<code> <code>
var positions = line.geometry.attributes.position.array; var positions = line.geometry.attributes.position.array;
var x = y = z = index = 0; var x, y, z, index;
x = y = z = index = 0;
for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) { for ( var i = 0, l = MAX_POINTS; i < l; i ++ ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册