From 6db90d5ce2398471c627e372780e2f98e587d5f9 Mon Sep 17 00:00:00 2001 From: Falko Schindler Date: Fri, 25 Oct 2024 14:08:47 +0200 Subject: [PATCH] fix camera looking back to the origin after calling `move_camera()` --- nicegui/elements/scene.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nicegui/elements/scene.js b/nicegui/elements/scene.js index 5926613ee..659e9265b 100644 --- a/nicegui/elements/scene.js +++ b/nicegui/elements/scene.js @@ -452,6 +452,8 @@ export default { if (camera_up_changed) { this.controls.dispose(); this.controls = new OrbitControls(this.camera, this.renderer.domElement); + this.controls.target.copy(this.look_at); + this.camera.lookAt(this.look_at); } }) .start();