From 1da28aa7d2bba41193ba35f1f052c7010920aeb5 Mon Sep 17 00:00:00 2001 From: wheattoast11 Date: Sat, 30 Nov 2024 15:35:11 -0600 Subject: [PATCH] fix scene.js --- src/three/Scene.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/three/Scene.js b/src/three/Scene.js index 72f44f1..ff1ce14 100644 --- a/src/three/Scene.js +++ b/src/three/Scene.js @@ -6,14 +6,15 @@ import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass'; import { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass'; export class Scene { - constructor() { + constructor(container, dimensions) { this.scene = new THREE.Scene(); - this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); + this.camera = new THREE.PerspectiveCamera(75, dimensions.width / dimensions.height, 0.1, 1000); this.renderer = new THREE.WebGLRenderer({ - canvas: document.querySelector('#bg'), antialias: true, alpha: true }); + this.renderer.setSize(dimensions.width, dimensions.height); + container.appendChild(this.renderer.domElement); this.composer = null; this.flowField = new FlowField();