import * as THREE from 'three' import { analysis } from '../business/statusManagement' export default function (gl, scene, camera) { let renderer = threeLayer.getThreeRenderer() global.scene = scene // camera.add(new THREE.PointLight(0xffffff)) // // camera.far = 60000 // camera.updateProjectionMatrix() // map.setPitch(60) /* var ground = new THREE.Mesh( new THREE.PlaneGeometry( 10000,10000,2,2 ), new THREE.MeshLambertMaterial({ color:0xffff00, side:THREE.DoubleSide, })) ground.name = "ground"; ground.position.set(10030408, -46147088, 5.999996185302734); ground.receiveShadow = true; ground.castShadow = true scene.add(ground); var box = new THREE.Mesh(new THREE.BoxGeometry(1000, 1000, 1000), new THREE.MeshLambertMaterial({ color: 0xff0000 })); box.position.set(10030208, -46146088, -1000.01798629760742); box.castShadow = true; scene.add(box); let directionalLight = new THREE.DirectionalLight(0xffffff, 10); directionalLight.position.set(10030808, -46146088, -2100); directionalLight.castShadow = true; directionalLight.shadow.camera.near = 100; directionalLight.shadow.camera.far = 10000; directionalLight.shadow.camera.left = -10000; directionalLight.shadow.camera.bottom = -10000; directionalLight.shadow.camera.right = 10000; directionalLight.shadow.camera.top = 10000; directionalLight.target = box; scene.add(directionalLight); let helper = new THREE.DirectionalLightHelper(directionalLight); helper.scale.set(1000,1000,1000) scene.add(helper); */ 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 ); map.setPitch(analysis().pitch) renderer.shadowMapEnabled = true; renderer.shadowMapSoft = true; }