ChimeraX docs icon

Command: turn

turnaxis [ angle  [ frames ]]] [ rock  N ] [ wobble  M ] [ wobbleAspect  fraction ] [ center  point-spec ] [ coordinateSystem  model-spec ] [ models  model-spec | atoms  atom-spec  ]

The turn command performs a rotation of angle (default 90°) around a specified axis (default y) at each of a specified number of image update frames (default 1 frame, except forever if rock or wobble is used; can be halted with stop). The commands turn and roll are the same except for their default values of angle and frames. See also: cofr, move, zoom, mousemode , torsion, making movies

The axis can be x, y, z or any of the other standard vector specifications. The angle can be positive or negative.

The rock option wags models back and forth around the specified axis with an amplitude of angle in each direction and N frames per cycle, continuing until all frames have elapsed. Like that of a pendulum, the movement is slower near the turnaround points 1/4 and 3/4 of the way through a cycle. See also: rock

The wobble option rotates models in a figure-eight motion with M frames per cycle, continuing until all frames have elapsed. The major rotation of the wobble is around axis with an amplitude of angle, and the minor rotation has an amplitude of angle multiplied by the wobbleAspect fraction (default 0.3). See also: wobble

The center default is the current center of rotation. Alternatively, the center can be given as x,y,z (three values separated by commas only), an atom-spec, or any of the other standard point specifications. If an atom-spec is used, the first model it contains will be used for reference frame pinning unless a coordinateSystem is also given.

A coordinateSystem can be specified by reference model number. If further motions are applied to an ongoing rotation, the center and axis will remain pinned relative to this reference model. If no reference model is given, axis coordinates will be interpreted in the screen coordinate system (X horizontal, Y vertical, Z in/out of screen) and center coordinates in the scene coordinate system.

The rotation applies to the specified models or atoms; if none are specified, the scene will be rotated as a whole. A movement of atoms cannot be undone except with a command that applies the opposite movement to the same atoms (not always easy to construct) or by reopening the original structure.

Commands continue to be processed while the requested motion is in progress. To pause command processing until the motion is finished, use the wait command. To halt an ongoing turn, use stop.

Scripting Independent Rotation

To script side-by-side rotations of multiple models about their own centers, a separate roll or turn command should be used for each model. The rotations will occur simultaneously as long as there are no intervening wait commands. After the rotation commands, there should be a single wait command with at least as many frames as the complete rotation. For example, to make a movie with a 360° rotation of two models about the Y (vertical) axis and their own centers in 1° increments:

movie record
turn y 1 360 model #1 center #1
turn y 1 360 model #2 center #2
wait 360
movie encode side-by-side-spin.mp4

See also: interactive independent rotation (mouse mode)

UCSF Resource for Biocomputing, Visualization, and Informatics / July 2022