12345678910111213141516171819202122232425262728293031323334353637 |
- import * as THREE from 'three'
- import { threeLayer } from './initScene3D'
- import { analysis } from '../business/statusManagement'
- let setCount = 0
- export default function (gl, scene, camera) {
- let renderer = threeLayer.getThreeRenderer()
-
- global.scene = scene
- let ambientLight = new THREE.AmbientLight( 0x262321, 1)
- scene.add(ambientLight)
- let frontLight = new THREE.DirectionalLight( 0xffffff, 0.2 );
- frontLight.position.set(1,0,0)
- scene.add( new THREE.DirectionalLightHelper(frontLight) )
- scene.add( frontLight );
- let backLight = new THREE.DirectionalLight( 0xffffff, 0.2);
- backLight.position.set(-1,0,0)
- scene.add( new THREE.DirectionalLightHelper(backLight) )
- scene.add( backLight );
- let sunLight = new THREE.DirectionalLight( 0xf2fee7, 1 );
- sunLight.position.set(80,0,-80).normalize();
- sunLight.castShadow = true;
- scene.add( sunLight );
-
- renderer.shadowMapEnabled = true;
- renderer.shadowMapSoft = true;
- if (++setCount === 1) {
- map.setPitch(analysis().pitch)
- }
- }
|