This commit is contained in:
2025-03-22 19:16:23 +02:00
parent 25df07c250
commit 600382356f
3 changed files with 8 additions and 7 deletions
+2 -1
View File
@@ -131,7 +131,8 @@ export default {
window.addEventListener('resize', this.resize); window.addEventListener('resize', this.resize);
}, },
unmounted(){ unmounted(){
window,removeEventListener('resize', this.resize); window.removeEventListener('resize', this.resize);
gameEngine.stop();
}, },
methods:{ methods:{
async loadScenario(){ async loadScenario(){
@@ -119,7 +119,7 @@ export default {
this.object.scenes = this.object.scenes || []; this.object.scenes = this.object.scenes || [];
}, },
unmounted(){ unmounted(){
window,removeEventListener('resize', this.resize); window.removeEventListener('resize', this.resize);
}, },
computed:{ computed:{
vb(){ vb(){
+5 -5
View File
@@ -35,10 +35,10 @@ class GameEngine {
// let light = new THREE.AmbientLight( 0x404040, 300 ); // soft white light // let light = new THREE.AmbientLight( 0x404040, 300 ); // soft white light
// scene.add( this.light ); // scene.add( this.light );
const dirLight = new THREE.DirectionalLight( 0xffffff, 1 ); const dirLight = new THREE.DirectionalLight( 0xffffff, 4 );
dirLight.color.setHSL( 0.1, 1, 0.95 ); dirLight.color.setHSL( 0.1, 1, 0.95 );
dirLight.position.set( - 1, 1.75, 1 ); dirLight.position.set( -12, 33, 37 );
dirLight.position.multiplyScalar( 20 ); //dirLight.position.multiplyScalar( 20 );
scene.add( dirLight ); scene.add( dirLight );
dirLight.castShadow = true; dirLight.castShadow = true;
@@ -53,8 +53,8 @@ class GameEngine {
dirLight.shadow.camera.top = d; dirLight.shadow.camera.top = d;
dirLight.shadow.camera.bottom = - d; dirLight.shadow.camera.bottom = - d;
dirLight.shadow.camera.far = 3500; dirLight.shadow.camera.far = 1000;
dirLight.shadow.bias = - 0.0001; dirLight.shadow.bias = - 0.001;
const renderer = new THREE.WebGLRenderer({ const renderer = new THREE.WebGLRenderer({
antialias: true, antialias: true,