Capítulo 569 de 859
A series of lines drawn between pairs of vertices.
This adds functionality beyond LineSegments, like arbitrary line width and changing width to be in world units. Line2 extends this object, forming a polyline instead of individual segments.
This module can only be used with WebGLRenderer. When using WebGPURenderer, import the class from lines/webgpu/LineSegments2.js.
const geometry = new LineSegmentsGeometry();
geometry.setPositions( positions );
geometry.setColors( colors );
const material = new LineMaterial( { linewidth: 5, vertexColors: true } };
const lineSegments = new LineSegments2( geometry, material );
scene.add( lineSegments );
Constructor
| Signature |
|---|
new LineSegments2( geometry : LineSegmentsGeometry, material : LineMaterial ) |
Properties
| Property | Description |
|---|---|
.isLineSegments2 : boolean (readonly) | This flag can be used for type testing. |
Methods
| Method | Description |
|---|---|
.computeLineDistances() : LineSegments2 | Computes an array of distance values which are necessary for rendering dashed lines. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very be… |
.raycast( raycaster : Raycaster, intersects : Array.<Object> ) | Computes intersection points between a casted ray and this instance. |