Skip to contents

Move an object to a new position

Usage

move_to(
  scene,
  position,
  duration = 1,
  easing = "smooth",
  path = "linear",
  target_object = NULL
)

Arguments

scene

A Scene object

position

Target position as c(x, y) or c(x, y, z)

duration

Duration in seconds

easing

Easing function

path

Type of path ("linear", "arc")

target_object

Optional ID of specific object to move

Value

The Scene object (invisibly) for piping

Examples

if (FALSE) { # \dontrun{
scene("move_demo") %>%
  add_circle(radius = 0.5, position = c(-3, 0, 0)) %>%
  grow_from_center() %>%
  move_to(c(3, 0, 0), duration = 2) %>%
  render()
} # }