Learn R Programming

NGLVieweR (version 1.4.0)

setRotation: Rotate View

Description

Set rotation for the representation

Usage

setRotation(NGLVieweR, x = 0, y = 0, z = 0, degrees = TRUE)

Value

NGLVieweR object with updated rotateView parameters.

Arguments

NGLVieweR

A NGLVieweR object.

x

Rotation angle around the x-axis. Default is 0.

y

Rotation angle around the y-axis. Default is 0.

z

Rotation angle around the z-axis. Default is 0.

degrees

A logical value. If TRUE (default), the input angles are assumed to be in degrees and will be converted to radians. If FALSE, the angles are assumed to be in radians.

See Also

  • setScale()

  • zoomMove()

  • setPosition()

Other transformations: setPosition(), setScale(), zoomMove()

Examples

Run this code
NGLVieweR("7CID") %>%
stageParameters(backgroundColor = "white") %>%
addRepresentation("cartoon", param=list(name="cartoon", colorValue="red")) %>%
addRepresentation("ball+stick", param=list(name="ball+stick",
colorValue="yellow",
colorScheme="element",
sele="200")) %>%
setRotation(30, 45, 60, degrees = TRUE)

Run the code above in your browser using DataLab