一条连续的线。
它几乎和[page:LineSegments]是一样的,唯一的区别是它在渲染时使用的是[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP],
而不是[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINES]。
const material = new THREE.LineBasicMaterial({
color: 0x0000ff
});
const 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 ) );
const geometry = new THREE.BufferGeometry().setFromPoints( points );
const line = new THREE.Line( geometry, material );
scene.add( line );
[page:BufferGeometry geometry] —— 表示线段的顶点,默认值是一个新的[page:BufferGeometry]。
[page:Material material] —— 线的材质,默认值是一个新的具有随机颜色的[page:LineBasicMaterial]。
共有属性请参见其基类[page:Object3D]。
表示线段的顶点。
Read-only flag to check if a given object is of type [name].
线的材质。
An array of weights typically from 0-1 that specify how much of the morph is applied. Undefined by default, but reset to a blank array by [page:.updateMorphTargets]().
A dictionary of morphTargets based on the morphTarget.name property. Undefined by default, but rebuilt [page:.updateMorphTargets]().
共有方法请参见其基类 [page:Object3D]。
计算[page:LineDashedMaterial]所需的距离的值的数组。 对于几何体中的每一个顶点,这个方法计算出了当前点到线的起始点的累积长度。
在一条投射出去的[page:Ray](射线)和这条线之间产生交互。 [page:Raycaster.intersectObject]将会调用这个方法。
返回这条线及其子集的一个克隆对象。
Updates the morphTargets to have no influence on the object. Resets the [page:.morphTargetInfluences] and [page:.morphTargetDictionary] properties.
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]