-
Notifications
You must be signed in to change notification settings - Fork 0
/
lights.js
30 lines (22 loc) · 1.05 KB
/
lights.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import * as THREE from 'three';
import { RectAreaLightUniformsLib } from 'three/examples/jsm/lights/RectAreaLightUniformsLib.js'
// import { RectAreaLightHelper } from 'three/examples/jsm/helpers/RectAreaLightHelper.js';
//Lights
export function setupLights(scene, positions){
RectAreaLightUniformsLib.init();
const rearAreaLight = new THREE.RectAreaLight(0xffffff,5,8,48);
rearAreaLight.position.set(0,89,-115);
rearAreaLight.rotateX(Math.PI/-2);
rearAreaLight.rotateZ(Math.PI/-2);
const pointLightFront = new THREE.PointLight(0xff5555,350,0,2.1);
pointLightFront.castShadow = true;
pointLightFront.position.set(0, 19, 0);
const ambientLight = new THREE.AmbientLight(0xffffff,0.05);
const topLight = new THREE.PointLight(0xffffff,850,0,2);
topLight.position.set(0,125,-119);
topLight.castShadow = true;
scene.add(rearAreaLight, pointLightFront, ambientLight, topLight);
// const lightHelp = new THREE.PointLightHelper(barPointLightFront);
// const lightHelp = new RectAreaLightHelper(rearAreaLight);
// scene.add(lightHelp);
}