Skip to content

Commit

Permalink
Bring tutorial code snippets in-sync with latest source #6077 (#6128)
Browse files Browse the repository at this point in the history
  • Loading branch information
dancergraham authored Jun 1, 2023
1 parent a5be78c commit 86bcb13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Fix undefined names: docstr and VisibleDeprecationWarning (PR #3844)
* Corrected documentation for Tensor based PointClound, LineSet, TriangleMesh (PR #4685)
* Corrected documentation for KDTree (typo in Notebook) (PR #4744)
* Corrected documentation for visualisation tutorial
* Remove `setuptools` and `wheel` from requirements for end users (PR #5020)
* Fix various typos (PR #5070)
* Exposed more functionality in SLAM and odometry pipelines
Expand Down
24 changes: 12 additions & 12 deletions docs/tutorial/visualization/customized_visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Mimic draw_geometries() with Visualizer class

.. literalinclude:: ../../../examples/python/visualization/customized_visualization.py
:language: python
:lineno-start: 37
:lines: 37-44
:lineno-start: 39
:lines: 39-47
:linenos:

This function produces exactly the same functionality as the convenience function ``draw_geometries``.
Expand All @@ -25,8 +25,8 @@ Class ``Visualizer`` has a couple of variables such as a ``ViewControl`` and a `

.. literalinclude:: ../../../examples/python/visualization/customized_visualization.py
:language: python
:lineno-start: 70
:lines: 70-76
:lineno-start: 50
:lines: 50-56
:linenos:

Outputs:
Expand All @@ -40,8 +40,8 @@ To change field of view of the camera, it is first necessary to get an instance

.. literalinclude:: ../../../examples/python/visualization/customized_visualization.py
:language: python
:lineno-start: 47
:lines: 47-56
:lineno-start: 27
:lines: 27-36
:linenos:

The field of view (FoV) can be set to a degree in the range [5,90]. Note that ``change_field_of_view`` adds the specified FoV to the current FoV. By default, the visualizer has an FoV of 60 degrees. Calling the following code
Expand Down Expand Up @@ -71,8 +71,8 @@ Callback functions

.. literalinclude:: ../../../examples/python/visualization/customized_visualization.py
:language: python
:lineno-start: 59
:lines: 59-67
:lineno-start: 39
:lines: 39-47
:linenos:

Function ``draw_geometries_with_animation_callback`` registers a Python callback function ``rotate_view`` as the idle function of the main loop. It rotates the view along the x-axis whenever the visualizer is idle. This defines an animation behavior.
Expand All @@ -82,8 +82,8 @@ Function ``draw_geometries_with_animation_callback`` registers a Python callback

.. literalinclude:: ../../../examples/python/visualization/customized_visualization.py
:language: python
:lineno-start: 79
:lines: 79-108
:lineno-start: 59
:lines: 59-87
:linenos:

Callback functions can also be registered upon key press event. This script registered four keys. For example, pressing :kbd:`k` changes the background color to black.
Expand All @@ -96,8 +96,8 @@ Capture images in a customized animation

.. literalinclude:: ../../../examples/python/visualization/customized_visualization.py
:language: python
:lineno-start: 109
:lines: 111-162
:lineno-start: 90
:lines: 90-141
:linenos:

This function reads a camera trajectory, then defines an animation function ``move_forward`` to travel through the camera trajectory. In this animation function, both color image and depth image are captured using ``Visualizer.capture_depth_float_buffer`` and ``Visualizer.capture_screen_float_buffer`` respectively. The images are saved as png files.
Expand Down

0 comments on commit 86bcb13

Please sign in to comment.