Skip to content

Commit

Permalink
Remove hardcoded z-up for scene orbit controls
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Voigt committed Aug 20, 2024
1 parent be557ff commit 8c80453
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nicegui/elements/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default {
}
this.look_at = new THREE.Vector3(0, 0, 0);
this.camera.lookAt(this.look_at);
this.camera.up = new THREE.Vector3(0, 0, 1);
this.camera.up = new THREE.Vector3(this.camera_up[0], this.camera_up[1], this.camera_up[2]);
this.camera.position.set(0, -3, 5);

this.scene.add(new THREE.AmbientLight(0xffffff, 0.7 * Math.PI));
Expand Down
1 change: 1 addition & 0 deletions nicegui/elements/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def __init__(self,
self.camera = camera or self.perspective_camera()
self._props['camera_type'] = self.camera.type
self._props['camera_params'] = self.camera.params
self._props['camera_up'] = [self.camera.up_x, self.camera.up_y, self.camera.up_z]
self.objects: Dict[str, Object3D] = {}
self.stack: List[Union[Object3D, SceneObject]] = [SceneObject()]
self._click_handlers = [on_click] if on_click else []
Expand Down

0 comments on commit 8c80453

Please sign in to comment.