This repository has been archived by the owner on Jul 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cameras.html
2 lines (2 loc) · 13.5 KB
/
cameras.html
1
2
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Cameras · Makie Plotting Ecosystem</title><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script><link href="assets/favicon.ico" rel="icon" type="image/x-icon"/><link href="assets/syntaxtheme.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="index.html"><img src="assets/logo.png" alt="Makie Plotting Ecosystem logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Makie Plotting Ecosystem</a></span></div><form class="docs-search" action="search.html"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="index.html">Home</a></li><li><span class="tocitem">Basics</span><ul><li><a class="tocitem" href="basic-tutorial.html">Basic Tutorial</a></li><li><a class="tocitem" href="makielayout/tutorial.html">Layout Tutorial</a></li><li><a class="tocitem" href="animation.html">Animations</a></li><li><a class="tocitem" href="interaction.html">Observables & Interaction</a></li><li><input class="collapse-toggle" id="menuitem-2-5" type="checkbox"/><label class="tocitem" for="menuitem-2-5"><span class="docs-label">Plotting Functions</span><i class="docs-chevron"></i></label><ul class="collapsed"><li><a class="tocitem" href="plotting_functions/arrows.html">arrows</a></li><li><a class="tocitem" href="plotting_functions/band.html">band</a></li><li><a class="tocitem" href="plotting_functions/barplot.html">barplot</a></li><li><a class="tocitem" href="plotting_functions/contour.html">contour</a></li><li><a class="tocitem" href="plotting_functions/contourf.html">contourf</a></li><li><a class="tocitem" href="plotting_functions/density.html">density</a></li><li><a class="tocitem" href="plotting_functions/errorbars.html">errorbars</a></li><li><a class="tocitem" href="plotting_functions/heatmap.html">heatmap</a></li><li><a class="tocitem" href="plotting_functions/hist.html">hist</a></li><li><a class="tocitem" href="plotting_functions/image.html">image</a></li><li><a class="tocitem" href="plotting_functions/lines.html">lines</a></li><li><a class="tocitem" href="plotting_functions/linesegments.html">linesegments</a></li><li><a class="tocitem" href="plotting_functions/mesh.html">mesh</a></li><li><a class="tocitem" href="plotting_functions/meshscatter.html">meshscatter</a></li><li><a class="tocitem" href="plotting_functions/poly.html">poly</a></li><li><a class="tocitem" href="plotting_functions/rangebars.html">rangebars</a></li><li><a class="tocitem" href="plotting_functions/scatter.html">scatter</a></li><li><a class="tocitem" href="plotting_functions/scatterlines.html">scatterlines</a></li><li><a class="tocitem" href="plotting_functions/stem.html">stem</a></li><li><a class="tocitem" href="plotting_functions/streamplot.html">streamplot</a></li><li><a class="tocitem" href="plotting_functions/surface.html">surface</a></li><li><a class="tocitem" href="plotting_functions/text.html">text</a></li><li><a class="tocitem" href="plotting_functions/volume.html">volume</a></li></ul></li><li><a class="tocitem" href="theming.html">Theming</a></li></ul></li><li><span class="tocitem">Documentation</span><ul><li><a class="tocitem" href="plot_method_signatures.html">Plot Method Signatures</a></li><li><a class="tocitem" href="figure.html">Figure</a></li><li><input class="collapse-toggle" id="menuitem-3-3" type="checkbox"/><label class="tocitem" for="menuitem-3-3"><span class="docs-label">Layoutables & Widgets</span><i class="docs-chevron"></i></label><ul class="collapsed"><li><a class="tocitem" href="makielayout/layoutables.html">Layoutables</a></li><li><a class="tocitem" href="makielayout/axis.html">Axis</a></li><li><a class="tocitem" href="makielayout/axis3.html">Axis3</a></li><li><a class="tocitem" href="makielayout/box.html">Box</a></li><li><a class="tocitem" href="makielayout/button.html">Button</a></li><li><a class="tocitem" href="makielayout/colorbar.html">Colorbar</a></li><li><a class="tocitem" href="makielayout/gridlayout.html">GridLayout</a></li><li><a class="tocitem" href="makielayout/intervalslider.html">IntervalSlider</a></li><li><a class="tocitem" href="makielayout/label.html">Label</a></li><li><a class="tocitem" href="makielayout/legend.html">Legend</a></li><li><a class="tocitem" href="makielayout/lscene.html">LScene</a></li><li><a class="tocitem" href="makielayout/menu.html">Menu</a></li><li><a class="tocitem" href="makielayout/slider.html">Slider</a></li><li><a class="tocitem" href="makielayout/toggle.html">Toggle</a></li></ul></li><li><a class="tocitem" href="makielayout/layouting.html">How layouts work</a></li><li><a class="tocitem" href="generated/colors.html">Colors</a></li><li><a class="tocitem" href="generated/plot-attributes.html">Plot attributes</a></li><li><a class="tocitem" href="recipes.html">Plot Recipes</a></li><li><a class="tocitem" href="backends_and_output.html">Backends & Output</a></li><li><a class="tocitem" href="scenes.html">Scenes</a></li><li><a class="tocitem" href="lighting.html">Lighting</a></li><li class="is-active"><a class="tocitem" href="cameras.html">Cameras</a><ul class="internal"><li><a class="tocitem" href="#Controlling-the-camera"><span>Controlling the camera</span></a></li><li><a class="tocitem" href="#D-Camera"><span>3D Camera</span></a></li><li><a class="tocitem" href="#Updating-the-camera"><span>Updating the camera</span></a></li></ul></li><li><a class="tocitem" href="faq.html">Frequently Asked Questions</a></li><li><a class="tocitem" href="abstractplotting_api.html">API Reference AbstractPlotting</a></li><li><a class="tocitem" href="makielayout/reference.html">API Reference MakieLayout</a></li><li><a class="tocitem" href="generated/axis.html">Integrated Axes (Axis2D / Axis3D)</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Documentation</a></li><li class="is-active"><a href="cameras.html">Cameras</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="cameras.html">Cameras</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/JuliaPlots/AbstractPlotting.jl/blob/master/docs/src/cameras.md#" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Cameras"><a class="docs-heading-anchor" href="#Cameras">Cameras</a><a id="Cameras-1"></a><a class="docs-heading-anchor-permalink" href="#Cameras" title="Permalink"></a></h1><p>A <code>Camera</code> is simply a viewport through which the Scene is visualized. <code>Makie</code> offers 2D and 3D projections, and 2D plots can be projected in 3D!</p><p>To specify the camera you want to use for your Scene, you can set the <code>camera</code> attribute. Currently, we offer four types of camera:</p><p><a href="abstractplotting_api.html#AbstractPlotting.cam2d!-Tuple{SceneLike}"><code>cam2d!</code></a> <a href="abstractplotting_api.html#AbstractPlotting.cam3d!"><code>cam3d!</code></a> <a href="abstractplotting_api.html#AbstractPlotting.campixel!-Tuple{Any}"><code>campixel!</code></a> <a href="abstractplotting_api.html#AbstractPlotting.cam3d_cad!-Tuple{Any}"><code>cam3d_cad!</code></a></p><p>which will mutate the camera of the Scene into the specified type.</p><h2 id="Controlling-the-camera"><a class="docs-heading-anchor" href="#Controlling-the-camera">Controlling the camera</a><a id="Controlling-the-camera-1"></a><a class="docs-heading-anchor-permalink" href="#Controlling-the-camera" title="Permalink"></a></h2><p>We offer several functions to control the camera programatically. You can rotate, translate, zoom and change the speed of the camera, as well as setting it to "look at" a certain point.</p><p><a href="abstractplotting_api.html#AbstractPlotting.translate_cam!-Tuple{Scene, Union{Tuple{Vararg{T, N}}, StaticArrays.StaticVector{N, T}} where {N, T}}"><code>translate_cam!</code></a> <a href="abstractplotting_api.html#AbstractPlotting.rotate_cam!-Tuple{Scene, Vararg{Number, N} where N}"><code>rotate_cam!</code></a> <a href="abstractplotting_api.html#AbstractPlotting.zoom!-Tuple{Any, Any, Any, Bool}"><code>zoom!</code></a></p><p>In addition, the camera can be configured by setting the fields of <code>cam = cameracontrols(scene)</code>:</p><ul><li><code>pan_button</code>: The mouse button used for panning.</li><li><code>rotate_button</code>: The mouse button used for rotating the camera.</li><li><code>translationspeed</code>: This parameter allows to customize the panning speed.</li><li><code>rotationspeed</code>: This parameter allows to customize the camera rotation speed</li></ul><p>The other fields control camera positioning, and the camera needs to be updated (with <a href="scenes.html#AbstractPlotting.update_cam!"><code>update_cam!</code></a>) after changing these:</p><ul><li><code>lookat</code>: The camera is directed at this point.</li><li><code>eyeposition</code>: The camera is at this point.</li><li><code>upvector</code>: The camera's "up" direction follows this vector (normalized internally).</li><li><code>fov</code>: The field of view of the camera (not used for zooming internally).</li></ul><p>As an example, to set the rotation speed of the camera, simply execute <code>cam.rotationspeed[] = 0.05</code>.</p><h2 id="D-Camera"><a class="docs-heading-anchor" href="#D-Camera">3D Camera</a><a id="D-Camera-1"></a><a class="docs-heading-anchor-permalink" href="#D-Camera" title="Permalink"></a></h2><p>To force a plot to be visualized in 3D, you can set the limits to have a nonzero (z)-axis interval, or ensure that a 3D camera type is used. For example, you could pass the keyword argument <code>limits = Rect([0,0,0],[1,1,1])</code>, or <code>camera = cam3d!</code>.</p><p>You can use the camera given by <a href="abstractplotting_api.html#AbstractPlotting.campixel!-Tuple{Any}"><code>campixel!</code></a> (also called a pixel camera), to create a plot which looks like a 2D plot from the user perspective (it generates a subscene with an orthographic view, aligned to pixel space). To ensure that the camera's view is not modified, you can pass the attribute <code>raw = true</code>.</p><h2 id="Updating-the-camera"><a class="docs-heading-anchor" href="#Updating-the-camera">Updating the camera</a><a id="Updating-the-camera-1"></a><a class="docs-heading-anchor-permalink" href="#Updating-the-camera" title="Permalink"></a></h2><p>Often, when modifying the Scene, the camera can get "out of sync" with the Scene. To fix this, you can call the <a href="scenes.html#AbstractPlotting.update_cam!"><code>update_cam!</code></a> function on the Scene.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="lighting.html">« Lighting</a><a class="docs-footer-nextpage" href="faq.html">Frequently Asked Questions »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Saturday 10 April 2021 14:43">Saturday 10 April 2021</span>. Using Julia version 1.6.0.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>