LineSegments 分隔线段

—> Line —> Object3D

Line 的子类, 每两个点作为一条线段的端点. 运用 WebGL 中的 gl.LINE. 相关的还有 LineLineLoop.

function LineSegments( 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 LineSegments = new THREE.LineSegments(geometry, material); scene.add(LineSegments);

Attributes

type : String

Default value : LineSegments
Description : 类型.

isLineSegments : Boolean

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