ChimeraX docs icon

Command: view

The view command can:

See also: cofr, getcrd, zoom, camera, clip, windowsize, save image, matchmaker, align, fitmap, sym, vr, making images, making movies, Graphics Toolbar

Focusing and Reorienting the View

Usage: view  spec  [ orient ] [ pad  fraction ] [ clip  true | false ]
Usage: view  initial  model-spec

The view spec command translates the scene, zooms in or out, and (unless clip is false) places the near/far clipping planes to bracket the displayed parts of the specified items. Setting clip false will also deactivate any pre-existing near/far clipping. If nothing is specified (spec is blank or omitted), all displayed items will be included in the view and near/far clipping deactivated. The zoom level is adjusted to make the bounding box of the relevant items abut the edges of the graphics window minus a pad fraction (allowed values < 1.0, default 0.05 of the window width and height) The desired fraction will usually be positive, but negative values can be used to zoom in further. The center of rotation is set to fixed at the center of the bounding box of the relevant items, or if nothing is specified, allowed to vary according to the front center method.

The orient option additionally rotates the scene to a standard orientation with X-axis horizontal increasing rightward, Y-axis vertical increasing upward, and Z-axis perpendicular to the screen increasing toward the viewer; in other words, it aligns scene coordinates with screen coordinates.

The view initial command removes rotations and translations of models relative to the scene (aligns individual model coordinates with scene coordinates). An overall reset can be achieved with:

view orient; view initial

...where the second command only has an effect if a model has been moved separately, as in matching or fitting.

Named Views and Transitions

Usage: view  name  view-name
Usage: view  view-nameframes ]
Usage: view  deleteview-name | all )
Usage: view  list

The name option assigns view-name to the current view, including the positions of any models that have been moved separately. Subsequently, that view can be restored over a specified number of image update frames (default 1 frame). The delete option can be used to “forget” a specific view or all views. The list option reports the names of all currently saved views in the Log, and clicking a name therein restores the corresponding view.

Rotations and translations of the scene as a whole can be described as motions of the viewer or “camera.” For gradual changes between views (frames > 1), the camera is rotated with a linear change in angle from its orientation in the first view to its orientation in the second view, and simultaneously translated so that the center of rotation in the first view moves in a straight line in screen coordinates to the center of rotation in the second view. At the same time, the positions of any models that have been moved relative to the scene are interpolated between the two views.

Coordinate Systems

The scene coordinate system is subject to any global manipulations (rotations and translations of the scene as a whole) and is the same as the coordinate system of a model that has not been moved relative to other models.

The screen coordinate system has:

Applying Model Position to Other Models

Usage: view position  model-spec  sameAsModels  ref-model-spec

The view position command applies the transformation (rotation and translation relative to the scene) of a reference model to other models. Multiple reference models can be specified, in which case they will be paired in the given order with the models to be moved. Models with the same transformation will not necessarily be superimposed. For superposition, see: matchmaker, align, fitmap

Using Transformation Matrices

Usage: view matrixcamera  matrixC ] [ models  #N,matrixN,#M,matrixM, ... ]

The view matrix command uses input rotation-translation matrices to position the camera (thus the global scene) and/or individual models relative to the scene.

Without arguments, view matrix shows the current rotation and translation of the camera and of each model relative to the scene as matrices in the Log. Each matrix is reported as 12 comma-separated numbers, corresponding to a 3x3 rotation matrix and a translation vector in the fourth column. Ordering is row-by-row, such that the translation vector is given as the fourth, eighth, and twelfth numbers. The same format of each matrix as 12 comma-separated numbers is required to set the position of the camera and/or individually specified models #N, #M, etc. The numbers should be separated by commas only (no spaces).

The following commands are equivalent:

view matrix mod #1,1,0,0,0,0,1,0,0,0,0,1,0
view initial #1

UCSF Resource for Biocomputing, Visualization, and Informatics / October 2017