View source: R/animation_functions.R
mocap_plot_avatar | R Documentation |
mocap_plot_avartar
is called by the functions animate_global
, animate_anatomical
, and animate_movement
functions
after they have called mocap_plot_basic
mocap_plot_avatar(
.plot,
use_geom_point = TRUE,
line_colored = TRUE,
line_colored_alpha = 1,
line_black = TRUE,
line_black_alpha = 0.5,
point = TRUE,
point_alpha = 1,
up_column = U
)
.plot |
A ggplot2 object containg mocap data in the mocapr format as it it created by |
use_geom_point |
Defaults to TRUE. If TRUE, points in the animation will be created using ggplot2::geom_point(). If FALSE, points are created using ggforce::geom_circle(). This will ensure correct size-proportions of the points, and that no points are croped out of the animation. However, it comes at the prize of much longer rendering-times. |
line_colored |
Shall the joints be connected by colored lines? ( |
line_colored_alpha |
The alpha value of the colored lines connecting the joint centers. |
line_black |
Shall the joints be connected by black lines? ( |
line_black_alpha |
The alhpa value of the black lines connecting the joint centers. |
point |
Shall the joint centers be marked by points? ( |
point_alpha |
The alpha of the points or circles that mark the joint centers. |
up_column |
The unquoted name of the column that contains the Up direction. Defaults to |
A ggplot2 object
df <- dplyr::filter(mocapr::mocapr_data, movement_nr == 1)
df <- dplyr::filter(df, frame %in% c(1, 50, 75, 100))
df <- mocapr::animate_global(df,
return_data = TRUE)
df <- mocap_plot_basic(df,
planes = c("X", "Y"), # Because the data comes from animate_global()
planes_in_rows_or_cols = "rows",
col_facets = frame
)
mocap_plot_avatar(df,
up_column = Y) # Because the data comes from animate_global()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.