Materials for Line Geometry
Learn the line geometry and its types in Three.js.
Types of materials for THREE.Line
geometry
We’ve looked at materials that work with meshes. Three.js also provides materials that can be used together with line geometries.
The last couple of materials we’re going to look at can only be used on one specific mesh: THREE.Line
. As the name implies, this is just a single line that only consists of lines and doesn’t contain any faces. Three.js provides two different materials we can use on a THREE.Line
geometry, is as follows:
THREE.LineBasicMaterial
: This basic material for a line allows us to set the color andvertexColors
properties.THREE.LineDashedMaterial
: This has the same properties asTHREE.LineBasicMaterial
but allows us to create a dashed line effect by specifying dash and spacing sizes.
We’ll start with the basic variant; after that, we’ll look at the dashed variant.
The THREE.LineBasicMaterial
The ...