mirror of
https://github.com/seigler/webgl-threejs-hello
synced 2025-07-27 09:46:13 +00:00
⚡ Added an eyeball
This commit is contained in:
parent
2eeebe06e8
commit
8ffe124402
15 changed files with 381 additions and 16 deletions
26
app/js/components/Light.js
Normal file
26
app/js/components/Light.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
export function createLight() {
|
||||
|
||||
var lightGeometry = new THREE.SphereGeometry(0.1);
|
||||
|
||||
var lightMaterial = new THREE.MeshStandardMaterial({
|
||||
emissive: 0xffffee,
|
||||
emissiveIntensity: 1,
|
||||
color: 0x000000
|
||||
});
|
||||
|
||||
var light = new THREE.PointLight(0xffffff, 1, 20, 2);
|
||||
light.power = 50;
|
||||
light.castShadow = true;
|
||||
light.shadow.mapSize.width = 512;
|
||||
light.shadow.mapSize.heigth = 512;
|
||||
light.shadow.radius = 1.5;
|
||||
|
||||
light.add(new THREE.Mesh(lightGeometry, lightMaterial));
|
||||
light.position.set(0, 5, 3);
|
||||
|
||||
return light;
|
||||
}
|
||||
|
||||
export function createHemisphereLight() {
|
||||
return new THREE.HemisphereLight(0x303F9F, 0x111111, 3);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue