diff --git a/docs/manual/en/introduction/Drawing-lines.html b/docs/manual/en/introduction/Drawing-lines.html index 8572d36f977a28dbff0ef11fd180aa4f160b38af..38250263ca2f6a447721e56ec2dbd006558cf72d 100644 --- a/docs/manual/en/introduction/Drawing-lines.html +++ b/docs/manual/en/introduction/Drawing-lines.html @@ -39,10 +39,12 @@ var material = new THREE.LineBasicMaterial( { color: 0x0000ff } );

-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) ); +var points = []; +points.push( new THREE.Vector3( - 10, 0, 0 ) ); +points.push( new THREE.Vector3( 0, 10, 0 ) ); +points.push( new THREE.Vector3( 10, 0, 0 ) ); + +var geometry = new THREE.BufferGeometry().setFromPoints( points );

Note that lines are drawn between each consecutive pair of vertices, but not between the first and last (the line is not closed.)

diff --git a/docs/manual/zh/introduction/Drawing-lines.html b/docs/manual/zh/introduction/Drawing-lines.html index 12e030549cfda056da439c513c15c3fffc5e2830..9dd6c9796a7e2844a98a4e77da6331bf726389b7 100644 --- a/docs/manual/zh/introduction/Drawing-lines.html +++ b/docs/manual/zh/introduction/Drawing-lines.html @@ -41,10 +41,12 @@ var material = new THREE.LineBasicMaterial( { color: 0x0000ff } );

-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) ); +var points = []; +points.push( new THREE.Vector3( - 10, 0, 0 ) ); +points.push( new THREE.Vector3( 0, 10, 0 ) ); +points.push( new THREE.Vector3( 10, 0, 0 ) ); + +var geometry = new THREE.BufferGeometry().setFromPoints( points );

注意,线是画在每一对连续的顶点之间的,而不是在第一个顶点和最后一个顶点之间绘制线条(线条并未闭合)。