Continuously rotate a scene around the specified axis
m_spin(id, axis = "y", speed = 1)R3dmol id or a r3dmol object (the output from
r3dmol())
Axis ("x", "y", "z", "vx",
"vy", "vz")
to rotate around. Default "y". View relative (rather than model
relative) axes are prefixed with "v".
Speed multiplier for spin animation. Defaults to 1. Negative value reverses the direction of spin.
R3dmol id or a r3dmol object (the output from r3dmol())
library(r3dmol)
model <- r3dmol() %>%
m_add_model(data = pdb_6zsl, format = "pdb") %>%
m_set_style(style = m_style_cartoon(color = "spectrum")) %>%
m_zoom_to()
# spin the model
model %>% m_spin()
# reverses the direction of spin
model %>% m_spin(speed = -0.5)