From 56ee72a1998b1eb6e52b66948e837acf330d4a64 Mon Sep 17 00:00:00 2001 From: xxf <876029169@qq.com> Date: Wed, 2 Nov 2022 12:00:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E7=9B=B8=E6=9C=BA=E6=96=B9?= =?UTF-8?q?=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/useScene.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/useScene.ts b/src/useScene.ts index 926d93e..26590a1 100644 --- a/src/useScene.ts +++ b/src/useScene.ts @@ -41,6 +41,7 @@ function useScene(canvas: any, backgroundColor: string, isRotation?: boolean) { cameraRef.current = camera; + camera.up.set(0, 1, 0); camera.position.set(0, 0, 0); const scene = new THREE.Scene(); @@ -63,6 +64,7 @@ function useScene(canvas: any, backgroundColor: string, isRotation?: boolean) { renderer.outputEncoding = THREE.sRGBEncoding; const controls = new OrbitControls(camera, renderer.domElement); + controls.addEventListener('change', render); // use if there is no animation loop controls.update();