How to use the SpotLightHelper function from three

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

262
263
264
265
266
267
268
269
270
271


bulbLight.add(new THREE.Mesh(bulbGeometry, bulbMat));
//bulbLight.position.set(...position);
spotLight.castShadow = true;
lightHelper = new THREE.SpotLightHelper( spotLight );
//scene.add( lightHelper );
scene.add(spotLight.target)
scene.add(spotLight)
group.add(bulbLight)
fork icon26
star icon28
watch icon0

+ 2 other calls in file

287
288
289
290
291
292
293
294
295
296
}
else if (object.isDirectionalLight) {
    helper = new THREE.DirectionalLightHelper(object, 1);
}
else if (object.isSpotLight) {
    helper = new THREE.SpotLightHelper(object);
}
else if (object.isHemisphereLight) {
    helper = new THREE.HemisphereLightHelper(object, 1);
}
fork icon1
star icon3
watch icon0

68
69
70
71
72
73
74
75
76
77
});

// Lighting
const ambient = new THREE.AmbientLight(0x404040);
const spotlight = new THREE.SpotLight(0xffffff);
const lightHelper = new THREE.SpotLightHelper(spotlight);

// Voxels
const selectionGlow = new THREE.PointLight(0xffffff, 1, 50);
const materials = {
fork icon1
star icon1
watch icon0

+ 17 other calls in file

24
25
26
27
28
29
30
31
32
33

// add light to scene
const light = new three.SpotLight(0xffffff, 1)
light.position.set(-50, 50, 0)

// const h = new three.SpotLightHelper(light, 1, 0x333333)
// this.scene.add(h)


this.scene.add(light)
fork icon0
star icon2
watch icon0

158
159
160
161
162
163
164
165
166
167
light.position.set(radius * 2 + 100, radius * 2, 100);
light.castShadow = true;
light.shadow.mapSize.set(5200, 5200);
scene.add(light);

const helper = new THREE.SpotLightHelper(light, 5);
//helper.setClearColor(0x474747, 1);
//scene.add(helper);

const light2 = new THREE.DirectionalLight(0xfff0dd, 0.3);
fork icon0
star icon0
watch icon0

+ 3 other calls in file

101
102
103
104
105
106
107
108
109
110
    spotLight.angle = Math.PI / 16;
    spotLight.penumbra = 0.5;
    spotLight.castShadow = true;
    spotLight.position.set( obj.posX, obj.posY, obj.posZ );
	scene.add( spotLight );
	spotLightHelper = new THREE.SpotLightHelper( spotLight );
	scene.add( spotLightHelper );
	
}

fork icon0
star icon0
watch icon0

+ 6 other calls in file

236
237
238
239
240
241
242
243
244
245
light.position.set(radius * 2 + 100, radius * 2, 100);
light.castShadow = true;
light.shadow.mapSize.set(5200, 5200);
scene.add(light);

// const helper = new THREE.SpotLightHelper(light, 5);
//helper.setClearColor(0x474747, 1);
//scene.add(helper);

const light2 = new THREE.DirectionalLight(0xfff0dd, 0.3);
fork icon0
star icon0
watch icon0

60
61
62
63
64
65
66
67
68
69
spotLight2 = createSpotLight( 0x00FF7F );
spotLight3 = createSpotLight( 0x7F00FF );
spotLight1.position.set( 0, 30, -20 );
      spotLight2.position.set( -25, 30, 10 );
      spotLight3.position.set( 25, 30, 10 );  
      slHelper1 = new THREE.SpotLightHelper( spotLight1 );
      slHelper2 = new THREE.SpotLightHelper( spotLight2 );
      slHelper3 = new THREE.SpotLightHelper( spotLight3 );
      // spotLight1.visible = false; spotLight2.visible = false; spotLight3.visible = false; 
      slHelper1.visible = false; slHelper2.visible = false; slHelper3.visible = false;
fork icon0
star icon0
watch icon1

+ 47 other calls in file

Other functions in three

Sorted by popularity

function icon

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