plotMotionSingleFrame: Plot a single frame of 3D motion data

Description Usage Arguments References Examples

View source: R/plotMotionSingleFrame.R

Description

Plot a single 3D frame of the xyz data obtained with getMotionData(). The plot used is a scatterplot3d plot.

Usage

1
2
plotMotionSingleFrame(xyzList, childs, frame, lims, rotateAngle = 0,
  viewAngle = 40, mainTitle = frame, ...)

Arguments

xyzList

a list of xyz objects such as obtained with getMotionData() Each xyz object depicts the motion of a single skeleton

childs

the childs list of a asf object obtained with readASF()

frame

a frame number (currently unvalidated!)

lims

a list of limits for the x, y, z axes. Format: list(limX = c(min, max), limY = c(min, max), limZ = c(min, max))

rotateAngle

angle in degrees to rotate the entire skeleton around the Y (upwards) axis, defaults to 0

viewAngle

the scatterplot3d's angle parameter, defaults to 40

mainTitle

the scatterplot3d's main title parameter, defaults o frame number

...

additional arguments to the scatterplot3d function

References

A blog post describing the package with more examples: http://giorasimchoni.com/2017/08/08/2017-08-08-lambada-the-mocap-package/

The CMU Graphics Lab Motion Capture Database: http://mocap.cs.cmu.edu/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
asfFilePath <- system.file("extdata", "lambada.asf", package = "mocap")
asf <- readASF(asfFilePath)
amcFilePath <- system.file("extdata", "lambada.amc", package = "mocap")
amc <- readAMC(amcFilePath, asf)
xyz <- getMotionData(asf, amc)
limX <- c(min(unlist(lapply(xyz, function(x) min(x[, 1])))),
  max(unlist(lapply(xyz, function(x) max(x[, 1])))))
limY <- c(min(unlist(lapply(xyz, function(x) min(x[, 2])))),
  max(unlist(lapply(xyz, function(x) max(x[, 2])))))
limZ <- c(min(unlist(lapply(xyz, function(x) min(x[, 3])))),
  max(unlist(lapply(xyz, function(x) max(x[, 3])))))
lims <- list(limX = limX, limY = limY, limZ = limZ)
plotMotionSingleFrame(list(xyz), asf$childs, 1, lims)

gsimchoni/mocap documentation built on May 14, 2019, 11:16 a.m.