Object3D

Line

A continuous line.

This is nearly the same as LineSegments; the only difference is that it is rendered using gl.LINE_STRIP instead of gl.LINES

Example

var material = new v3d.LineBasicMaterial({ color: 0x0000ff }); var geometry = new v3d.Geometry(); geometry.vertices.push( new v3d.Vector3(-10, 0, 0), new v3d.Vector3(0, 10, 0), new v3d.Vector3(10, 0, 0) ); var line = new v3d.Line(geometry, material); scene.add(line);

Constructor

Line(geometry : Geometry, material : Material)

geometry — vertices representing the line segment(s). Default is a new BufferGeometry.
material — material for the line. Default is a new LineBasicMaterial with random color.

If no material is supplied, a randomized line material will be created and assigned to the object.

Properties

See the base Object3D class for common properties.

.isLine : Boolean

Used to check whether this or derived classes are lines. Default is true.

You should not change this, as it used internally for optimisation.

.geometry : Geometry

Vertices representing the line segment(s).

.material : Material

Material for the line.

Methods

See the base Object3D class for common methods.

.computeLineDistances () : Line

Computes an array of distance values which are necessary for LineDashedMaterial. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.

.raycast (raycaster : Raycaster, intersects : Array) : null

Get intersections between a casted Ray and this Line. Raycaster.intersectObject will call this method.

.clone () : Line

Returns a clone of this Line object and its descendants.

Source

For more info on how to obtain the source code of this module see this page.