{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "nbsphinx": "hidden" }, "outputs": [], "source": [ "import open3d as o3d\n", "import numpy as np\n", "import os\n", "import sys\n", "\n", "# monkey patches visualization and provides helpers to load geometries\n", "sys.path.append('..')\n", "import open3d_tutorial as o3dtut\n", "# change to True if you want to interact with the visualization windows\n", "o3dtut.interactive = not \"CI\" in os.environ" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Visualization\n", "## Function draw_geometries\n", "Open3D provides a convenient visualization function `draw_geometries` which takes a list of geometry objects (`PointCloud`, `TriangleMesh`, or `Image`), and renders them together. We have implemented many functions in the visualizer, such as rotation, translation, and scaling via mouse operations, changing rendering style, and screen capture. Press `h` inside the window to print out a comprehensive list of functions." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print(\"Load a ply point cloud, print it, and render it\")\n", "pcd = o3d.io.read_point_cloud(\"../../TestData/fragment.ply\")\n", "o3d.visualization.draw_geometries([pcd], zoom=0.3412, \n", " front=[0.4257, -0.2125, -0.8795],\n", " lookat=[2.6172, 2.0475, 1.532],\n", " up=[-0.0694, -0.9768, 0.2024])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```\n", "-- Mouse view control --\n", " Left button + drag : Rotate.\n", " Ctrl + left button + drag : Translate.\n", " Wheel button + drag : Translate.\n", " Shift + left button + drag : Roll.\n", " Wheel : Zoom in/out.\n", "\n", "-- Keyboard view control --\n", " [/] : Increase/decrease field of view.\n", " R : Reset view point.\n", " Ctrl/Cmd + C : Copy current view status into the clipboard.\n", " Ctrl/Cmd + V : Paste view status from clipboard.\n", "\n", "-- General control --\n", " Q, Esc : Exit window.\n", " H : Print help message.\n", " P, PrtScn : Take a screen capture.\n", " D : Take a depth capture.\n", " O : Take a capture of current rendering settings.\n", "```\n", "\n", "