Description Usage Arguments Value Examples
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.
1 2 3 | m_translate(id, x, y, animationDuration, fixedPath)
m_translate_scene(id, x, y, animationDuration, fixedPath)
|
id |
R3dmol |
x |
Relative change |
y |
Relative change |
animationDuration |
an optional parameter of milliseconds |
fixedPath |
if |
R3dmol id
or a r3dmol
object (the output from
r3dmol()
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 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()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.