LineLoop 封闭线段

—> Line —> Object3D

Line 的子类, 只是自动的帮你把两端点连接起来. 运用 WebGL 中的 gl.LINE_LOOP. 相关的还有 LineLineSegments.

function LineLoop( geometry, material, mode ) { } var pointArr = [], radius = 3 angle = 0, step = Math.PI / 3; for(var i = 0; i < 6; i++){ var x = radius * Math.cos(angle), y = radius * Math.sin(angle), z = 0; pointArr.push(new THREE.Vector3(x, y, z)); angle += step; } var geometry = new THREE.Geometry(); geometry.vertices = pointArr; var material = new THREE.LineBasicMaterial({ color: 0xff3399 }); var lineLoop = new THREE.LineLoop(geometry, material); scene.add(lineLoop);

Attributes

type : String

Default value : LineLoop
Description : 类型.

isLineLoop : Boolean

Default value : true (只读)
Description : 类型是否为LineLoop.