Sets the view to the specified translation, zoom, rotation and style

m_set_view(id, arg, style)

Arguments

id

R3dmol id or a r3dmol object (the output from r3dmol())

arg

Vector formatted view setting, c(pos.x, pos.y, pos.z, rotationGroup.position.z, q.x, q.y, q.z, q.w). Requires any one of q.x, q.y, q.z, q.w to be set to 1 to enable mouse control, otherwise only static image is rendered.

style

css style object in list.

Value

R3dmol id or a r3dmol object (the output from r3dmol())

Examples

library(r3dmol)

r3dmol() %>%
  m_add_model(data = pdb_6zsl, format = "pdb") %>%
  m_set_style(style = m_style_cartoon()) %>%
  m_set_view(arg = c(20, -20, 10, -200, 0, 1, 0, 0)) %>%
  m_add_outline(color = "blue")