Materials you can use for a line geometry
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 you can use on a THREE.Line
geometry, as follows:
THREE.LineBasicMaterial
: This basic material for a line allows you to set thecolor
andvertexColors
properties.THREE.LineDashedMaterial
: This has the same properties asTHREE.LineBasicMaterial
but allows you to create a dashed line effect by specifyingdash
andspacing
sizes.
We’ll start with the basic variant; after that, we’ll look at the dashed variant.
THREE.LineBasicMaterial
The materials that are available for the THREE.Line
geometry are very simple. It inherits all of the properties from THREE.Material
, but the following are the properties that are most important for this material: