27b1fc75ed376bdf08ea2e2315068860b488f2bd.svn-base 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import * as THREE from 'three'
  2. import { threeLayer } from './initScene3D'
  3. import { analysis } from '../business/statusManagement'
  4. let setCount = 0
  5. export default function (gl, scene, camera) {
  6. let renderer = threeLayer.getThreeRenderer()
  7. global.scene = scene
  8. let ambientLight = new THREE.AmbientLight( 0x262321, 0.3)
  9. scene.add(ambientLight)
  10. let frontLight = new THREE.DirectionalLight( 0xffffff, 0.2);
  11. frontLight.position.set(0,1,0)
  12. scene.add( new THREE.DirectionalLightHelper(frontLight) )
  13. scene.add( frontLight );
  14. let backLight = new THREE.DirectionalLight( 0xffffff, 0.1);
  15. backLight.position.set(0,0,1)
  16. scene.add( new THREE.DirectionalLightHelper(backLight) )
  17. scene.add( backLight );
  18. let sunLight = new THREE.DirectionalLight( 0xf2fee7, 0.6 );
  19. sunLight.position.set(80,0,-80).normalize();
  20. sunLight.castShadow = true;
  21. scene.add( sunLight );
  22. renderer.shadowMapEnabled = true;
  23. renderer.shadowMapSoft = true;
  24. if (++setCount === 1) {
  25. map.setPitch(analysis().pitch)
  26. }
  27. }