[page:Object3D] →

[name]

A line or a series of lines.

Example

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

Constructor

[name]( [page:Geometry geometry], [page:Material material], [page:Integer type] )

geometry — Vertices representing the line segment(s).
material — Material for the line. Default is [page:LineBasicMaterial LineBasicMaterial].
type — Connection type between vertices. Default is THREE.LineStrip.
If no material is supplied, a randomized line material will be created and assigned to the object.
Also, if no type is supplied, the default (THREE.LineStrip) will be used).

Properties

[property:Geometry geometry]

Vertices representing the line segment(s).

[property:Material material]

Material for the line.

[property:Integer type]

Possible values: THREE.LineStrip or THREE.LinePieces. THREE.LineStrip will draw a series of segments connecting each point (first connected to the second, the second connected to the third, and so on and so forth); and THREE.LinePieces will draw a series of pairs of segments (first connected to the second, the third connected to the fourth, and so on and so forth).
In OpenGL terms, LineStrip is the classic GL_LINE_STRIP and LinePieces is the equivalent to GL_LINES.

Methods

[method:Array raycast]([page:Raycaster raycaster], [page:Array intersects])

Get intersections between a casted ray and this Line. [page:Raycaster.intersectObject] will call this method.

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]