m_translate {r3dmol} | R Documentation |
Translate current view or models by x,y screen coordinates
Description
m_translate()
pans the camera rather than translating the model.
m_translate_scene()
translates the models relative to the current
view. It does not change the center of rotation.
Usage
m_translate(id, x, y, animationDuration, fixedPath)
m_translate_scene(id, x, y, animationDuration, fixedPath)
Arguments
id |
R3dmol |
x |
Relative change |
y |
Relative change |
animationDuration |
an optional parameter of milliseconds |
fixedPath |
if |
Value
R3dmol id
or a r3dmol
object (the output from
r3dmol()
)
Examples
library(r3dmol)
# Translate current view by x,y screen coordinates
r3dmol() %>%
m_add_model(data = pdb_1j72, format = "pdb") %>%
m_set_style(style = c(m_style_cartoon(), m_style_stick())) %>%
m_translate(
x = 200,
y = 50,
animationDuration = 1000
) %>%
m_rotate(
angle = 90,
axis = "z",
animationDuration = 1000
) %>%
m_zoom_to()
# Translate current models by x,y screen coordinates
r3dmol() %>%
m_add_model(data = pdb_1j72, format = "pdb") %>%
m_set_style(style = c(m_style_cartoon(), m_style_stick())) %>%
m_translate_scene(
x = 200,
y = 50,
animationDuration = 1000
) %>%
m_rotate(
angle = 90,
axis = "z",
animationDuration = 1000
) %>%
m_zoom_to()
[Package r3dmol version 0.1.2 Index]