{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# GUI Basics\n", "\n", "In this example we wil learn the basic interaction with the `plot`'s user interface." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import k3d\n", "plot = k3d.plot()\n", "plot += k3d.points([0, 0, 0, 1, 1, 1])\n", "plot.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Expected result:\n", "![A simple plot](assets/04_basic_gui.png \"A plot with two points, for learing GUI features.\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## View / camera position adjustment\n", "\n", "The plot can be adjusted using mouse actions:\n", "- mouse wheel / scroll controls the zooming in or out\n", "- dragging with left mouse button rotates the plot (all directions)\n", "- dragging with right mouse button translates the plot (all directions)\n", "- dragging with wheel / both mose buttons: zooms in or out (only vertical)\n", "\n", "To return to the default camera position, press the \"Camera reset\" icon from the top-right toolbar" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Fullscreen mode\n", "\n", "It is possible to switch the plot to fullscreen mode using the \"Fullscreen\" icon from the toolbar.\n", "To exit fullscreen mode press the Esc key (there should be a notification from your browser).\n", "\n", "## Viewing plots in a detached window\n", "\n", "Especially in multiple monitor setups it may be useful to detach the plot to a dedicated window. This is achieved by clicking the \"Detach widget\" icon.\n", "\n", "## Downloading current view as PNG\n", "\n", "To save a snapshot of the current view, press the \"Save screenshot\" icon from the toolbar.\n", "\n", "\n", "The filename will be generated as \"K3D-\", then a string of digits (technically: decimal timestamp) and then \".png\". The PNG file containing the `plot`'s interior (no UI decorations) will be processed as a regular download." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This example was just a short description of the UI interaction with K3D plots. Some of these actions (camera adjustment and screenshot retrieval) can be done programmatically, which will be shown in other examples." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.5" } }, "nbformat": 4, "nbformat_minor": 2 }