Skip to content

Commit

Permalink
remove orthographic cameras from next release
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Apr 15, 2024
1 parent c36834a commit dca25d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions nicegui/elements/scene.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio
from dataclasses import dataclass
from typing import Any, Callable, Dict, List, Literal, Optional, Union
from typing import Any, Callable, Dict, List, Optional, Union

from typing_extensions import Self

Expand Down Expand Up @@ -71,7 +71,6 @@ def __init__(self,
width: int = 400,
height: int = 300,
grid: bool = True,
camera_type: Literal['perspective', 'orthographic'] = 'perspective',
on_click: Optional[Callable[..., Any]] = None,
on_drag_start: Optional[Callable[..., Any]] = None,
on_drag_end: Optional[Callable[..., Any]] = None,
Expand All @@ -87,7 +86,6 @@ def __init__(self,
:param width: width of the canvas
:param height: height of the canvas
:param grid: whether to display a grid
:param camera_type: type of camera to use (``'perspective'`` or ``'orthographic'``)
:param on_click: callback to execute when a 3D object is clicked
:param on_drag_start: callback to execute when a 3D object is dragged
:param on_drag_end: callback to execute when a 3D object is dropped
Expand All @@ -97,7 +95,7 @@ def __init__(self,
self._props['width'] = width
self._props['height'] = height
self._props['grid'] = grid
self._props['camera_type'] = camera_type
self._props['camera_type'] = 'perspective'
self.objects: Dict[str, Object3D] = {}
self.stack: List[Union[Object3D, SceneObject]] = [SceneObject()]
self.camera: SceneCamera = SceneCamera()
Expand Down
12 changes: 6 additions & 6 deletions website/documentation/content/scene_documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ async def wait_for_init() -> None:
scene.move_camera(x=1, y=-1, z=1.5, duration=2)


@doc.demo('Orthographic Camera', '''
You can use the `camera_type` argument to `ui.scene` to use an orthographic instead of a perspective camera.
''')
def orthographic_camera() -> None:
with ui.scene(camera_type='orthographic').classes('w-full h-64') as scene:
scene.box()
# @doc.demo('Orthographic Camera', '''
# You can use the `camera_type` argument to `ui.scene` to use an orthographic instead of a perspective camera.
# ''')
# def orthographic_camera() -> None:
# with ui.scene(camera_type='orthographic').classes('w-full h-64') as scene:
# scene.box()


doc.reference(ui.scene)

0 comments on commit dca25d3

Please sign in to comment.