How to use the LineDashedMaterial function from three
Find comprehensive JavaScript three.LineDashedMaterial code examples handpicked from public code repositorys.
GitHub: MozillaReality/puzzle-rain
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();
10
33
10
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
4
6
3
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, } ) );
0
4
1
+ 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,
0
2
1
GitHub: will3/brock2
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,
0
1
2
three.Vector3 is the most popular function in three (22341 examples)