R/animation.R
, R/rd.R
m_translate.Rd
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.
m_translate(id, x, y, animationDuration, fixedPath)
m_translate_scene(id, x, y, animationDuration, fixedPath)
R3dmol id
or a r3dmol
object (the output from
r3dmol()
)
Relative change numeric
in view coordinates of camera
Relative change numeric
in view coordinates of camera
an optional parameter of milliseconds numeric
that denotes the duration of a zoom animation
if true
animation is constrained to
requested motion, overriding updates that happen during the animation
R3dmol id
or a r3dmol
object (the output from
r3dmol()
)
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()