f4147a7e4adb98953bdb755b381ec99a4dcba887.svn-base 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import * as THREE from 'three'
  2. import { analysis } from '../business/statusManagement'
  3. export default function (gl, scene, camera) {
  4. let renderer = threeLayer.getThreeRenderer()
  5. global.scene = scene
  6. // camera.add(new THREE.PointLight(0xffffff))
  7. // // camera.far = 60000
  8. // camera.updateProjectionMatrix()
  9. // map.setPitch(60)
  10. /*
  11. var ground = new THREE.Mesh( new THREE.PlaneGeometry( 10000,10000,2,2 ), new THREE.MeshLambertMaterial({ color:0xffff00, side:THREE.DoubleSide, }))
  12. ground.name = "ground";
  13. ground.position.set(10030408, -46147088, 5.999996185302734);
  14. ground.receiveShadow = true;
  15. ground.castShadow = true
  16. scene.add(ground);
  17. var box = new THREE.Mesh(new THREE.BoxGeometry(1000, 1000, 1000), new THREE.MeshLambertMaterial({ color: 0xff0000 }));
  18. box.position.set(10030208, -46146088, -1000.01798629760742);
  19. box.castShadow = true;
  20. scene.add(box);
  21. let directionalLight = new THREE.DirectionalLight(0xffffff, 10);
  22. directionalLight.position.set(10030808, -46146088, -2100);
  23. directionalLight.castShadow = true;
  24. directionalLight.shadow.camera.near = 100;
  25. directionalLight.shadow.camera.far = 10000;
  26. directionalLight.shadow.camera.left = -10000;
  27. directionalLight.shadow.camera.bottom = -10000;
  28. directionalLight.shadow.camera.right = 10000;
  29. directionalLight.shadow.camera.top = 10000;
  30. directionalLight.target = box;
  31. scene.add(directionalLight);
  32. let helper = new THREE.DirectionalLightHelper(directionalLight);
  33. helper.scale.set(1000,1000,1000)
  34. scene.add(helper);
  35. */
  36. let pointLight = new THREE.PointLight(0xffffff);
  37. // pointLight.castShadow = true;
  38. // pointLight.shadow.camera.far = 50000;
  39. map.setPitch(analysis().pitch)
  40. camera.add(pointLight )
  41. renderer.shadowMapEnabled = true;
  42. renderer.shadowMapSoft = false;
  43. }