Skip to main content

Material

LineBasicMaterial

A material for drawing wireframe-style geometries.

Code Example

const material = new THREE.LineBasicMaterial( { color: 0xffffff, linewidth: 1,
linecap: 'round', //ignored by WebGLRenderer linejoin: 'round' //ignored by
WebGLRenderer } );

Examples

[example:webgl_buffergeometry_drawrange WebGL / buffergeometry / drawrange]
[example:webgl_buffergeometry_lines WebGL / buffergeometry / lines]
[example:webgl_buffergeometry_lines_indexed WebGL / buffergeometry / lines / indexed]
[example:webgl_decals WebGL / decals]
[example:webgl_geometry_nurbs WebGL / geometry / nurbs]
[example:webgl_geometry_shapes WebGL / geometry / shapes]
[example:webgl_geometry_spline_editor WebGL / geometry / spline / editor]
[example:webgl_interactive_buffergeometry WebGL / interactive / buffergeometry]
[example:webgl_interactive_voxelpainter WebGL / interactive / voxelpainter]
[example:webgl_lines_colors WebGL / lines / colors]
[example:webgl_lines_dashed WebGL / lines / dashed]
[example:physics_ammo_rope physics / ammo / rope]

Constructor

LineBasicMaterial

function LineBasicMaterial( parameters: Object ): void;  

parameters - (optional) an object with one or more properties defining the material's appearance. Any property of the material (including any property inherited from Material) can be passed in here.

The exception is the property color, which can be passed in as a hexadecimal string and is 0xffffff (white) by default. Color.set( color ) is called internally.

Properties

See the base Material class for common properties.

color

color: Color;  

Color of the material, by default set to white (0xffffff).

fog

fog: Boolean;  

Whether the material is affected by fog. Default is true.

linewidth

linewidth: Float;  

Controls line thickness. Default is 1.

Due to limitations of the OpenGL Core Profile with the WebGL renderer on most platforms linewidth will always be 1 regardless of the set value.

linecap

linecap: String;  

Define appearance of line ends. Possible values are 'butt', 'round' and 'square'. Default is 'round'.

This corresponds to the 2D Canvas lineCap property and it is ignored by the WebGL renderer.

linejoin

linejoin: String;  

Define appearance of line joints. Possible values are 'round', 'bevel' and 'miter'. Default is 'round'.

This corresponds to the 2D Canvas lineJoin property and it is ignored by the WebGL renderer.

map

map: Texture;  

Sets the color of the lines using data from a Texture.

Methods

See the base Material class for common methods.

Source

src/materials/LineBasicMaterial.js