| | |
| | | this.initStats(); |
| | | this.initLight(); |
| | | this.initReSize(this); |
| | | this.initObjectSelect(); |
| | | this.initPointLockControl(this); |
| | | this.initFloor(); |
| | | this.initBuilding(); |
| | |
| | | // this.renderer.toneMapping = THREE.CineonToneMapping; // 色调 |
| | | this.renderer.setSize(window.innerWidth, window.innerHeight); |
| | | this.renderer.setPixelRatio( window.devicePixelRatio ); |
| | | this.renderer.shadowMap.enabled = true; |
| | | this.renderer.shadowMap.enabled = false; |
| | | this.renderer.shadowMap.type = THREE.BasicShadowMap; |
| | | this.dom = document.getElementById("container"); |
| | | this.dom.appendChild(this.renderer.domElement); |
| | |
| | | object.renderer.setSize(window.innerWidth, window.innerHeight); |
| | | }, false); |
| | | } |
| | | this.initOutLine = function(){ |
| | | // this.outlinePass = new THREE.OutlinePass(new THREE.Vector2(window.innerWidth, window.innerWidth), this.scene, this.camera); |
| | | // this.outlinePass.edgeStrength = 10;//包围线浓度 |
| | | // this.outlinePass.edgeGlow = 0.1;//边缘线范围 |
| | | // this.outlinePass.edgeThickness = 1;//边缘线浓度 |
| | | // this.outlinePass.pulsePeriod = 2;//包围线闪烁评率 |
| | | // this.outlinePass.visibleEdgeColor.set('#B31985');//包围线颜色 |
| | | // this.outlinePass.hiddenEdgeColor.set('#190a05');//被遮挡的边界线颜色 |
| | | } |
| | | this.initObjectSelect = function(){ |
| | | new ObjectSelect(this.scene, this.camera); |
| | | } |
| | | this.initPointLockControl = function(object){ |
| | | this.controls = new PointerLockControls( this.camera, document.body ); |
| | | this.raycaster = new THREE.Raycaster( new THREE.Vector3(), new THREE.Vector3( 0, - 1, 0 ), 0, 50 ); |