[page:Object3D] →
[name]
A continuous line.
This is nearly the same
as [page:LineSegments]; the only difference is that it is rendered using
[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP]
instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements 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
[name]([page:Geometry geometry], [page:Material material])
[page:Geometry geometry] — vertices representing the line segment(s). Default is a new [page:new BufferGeometry].
[page:Material material] — material for the line. Default is a new [page: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 [page:Object3D] class for common properties.
[property:Boolean isLine]
Used to check whether this or derived classes are lines. Default is *true*.
You should not change this, as it used internally for optimisation.
[property:Geometry geometry]
Vertices representing the line segment(s).
[property:Material material]
Material for the line.
Methods
See the base [page:Object3D] class for common methods.
[method:Array raycast]([page:Raycaster raycaster], [page:Array intersects])
Get intersections between a casted [page:Ray] and this Line.
[page:Raycaster.intersectObject] will call this method.
[method:Line clone]()
Returns a clone of this Line object and its descendants.
[sourceHint]