# Camera Controls

These settings affect the 3D camera view in polyscope. It is often convenient to set them just before calling polyscope::init, but they may set be anywhere.

#include "polyscope/polyscope.h"

// a few camera options
polyscope::view::upDir = UpDir::ZUp;
polyscope::view::style = NavigateStyle::Free;

// initialize
polyscope::init();


### Options

NavigateStyle view::style

The style of the camera navigation. Affects what happens when you drag to rotate around the 3D view with your mouse.

This value can be manually set under the view menu of the ui. Programmatically, the enum view::NavigateStyle contains various settings:

• NavigateStyle::Turntable The up direction (see below) is always fixed vertically, with rotation along the azumith and altitude directions.
• NavigateStyle::Free The camera is free to take any orientation, rotation is always about relative to the current camera.
• NavigateStyle::Planar The camera is locked in to a 2D view of the XY plane, with no rotation (see 2D data).

Example:

polyscope::view::style = NavigateStyle::Free;


UpDir view::upDir
##### up direction

3D data is typically oriented with some natural “up” direction, but not everyone agrees as to which coordinate axis is “up”. Computer graphics and vision often use a Y-up convention, where science and engineering more commonly use Z-up.

This setting affects default orientation of the view, the behavior of some navigation styles (esp. Turntable), and the orientation of the ground plane.

This value can be manually set under the view menu of the ui. Programmatically, the enum view::UpDir contains various settings:

• UpDir::XUp The positive X-axis is up.
• UpDir::YUp The positive Y-axis is up.
• UpDir::ZUp The positive Z-axis is up.

Default: UpDir::Yup.

Example:

polyscope::view::upDir = UpDir::ZUp;
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.20131105184555054, "perplexity": 4480.013655139529}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-24/segments/1590347400101.39/warc/CC-MAIN-20200528201823-20200528231823-00583.warc.gz"}