How to use the LineDashedMaterial function from three

Find comprehensive JavaScript three.LineDashedMaterial code examples handpicked from public code repositorys.

34
35
36
37
38
39
40
41
42
43
this.numVertices = numVertices;
var geometryCircleLine = new THREE.CircleGeometry(1 * this.creature.radius, this.numVertices);
// Remove center vertex
geometryCircleLine.vertices.shift();

var materialCircleLine = new THREE.LineDashedMaterial({
  color: 0xffffff,
dashSize: 0.002, gapSize: 0.005,transparent: true, opacity: 0, depthWrite: false});
materialCircleLine.linewidth = 2;
geometryCircleLine.computeLineDistances();
fork icon10
star icon33
watch icon10

91
92
93
94
95
96
97
98
99
100
lineForce: new THREE.LineBasicMaterial( {
    color: 0xaaaaaa,
    transparent: false
} ),

lineExternal: new THREE.LineDashedMaterial( { 
    color: 0xcccccc, 
    dashSize: 0.3,
    gapSize: 0.1,
    linewidth: 1        // linewidth doesn't work on Windows due to ANGLE limitation
fork icon4
star icon6
watch icon3

183
184
185
186
187
188
189
190
191
192
if ( this.shouldSimplifyVertices && !initialVertex.shouldBeVisible ) continue;

// Line
let geometryPoints = new THREE.BufferGeometry().setFromPoints( [initialVertex, finalVertex] );
let line = new THREE.Line( geometryPoints, 
    new THREE.LineDashedMaterial( {
    color: 0x000000,
    dashSize: 0.03 * sceneScale,
    gapSize: 0.03 * sceneScale,
} ) );
fork icon0
star icon4
watch icon1

+ 3 other calls in file

24
25
26
27
28
29
30
31
32
33
const edges = new THREE.EdgesGeometry(geometry);

let material;

if (dashed) {
  material = new THREE.LineDashedMaterial({
    color,
    opacity,
    transparent,
    ...others,
fork icon0
star icon2
watch icon1

49
50
51
52
53
54
55
56
57
58
this.geometry = geometry;

var material = this.cache.materials['waypath'];
if (material === undefined) {
  material = this.cache.materials['waypath'] =
    new THREE.LineDashedMaterial({
      transparent: true,
      opacity: 0.5,
      color: 0xffffff,
      dashSize: 1,
fork icon0
star icon1
watch icon2

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)