Description Usage Arguments Details Value Author(s) See Also Examples
3D rendering of animal attitude using the "rgl" package.
1 | animalplot3d(roll, pitch, yaw, angle = "degree", add = FALSE, ...)
|
roll |
Roll angle of the animal |
pitch |
Pitch angle of the animal |
yaw |
Yaw angle of the animal |
angle |
Unit of angular measure for input. Default is "degree", but the function will accept "radian". All three input angles must be either "degree" or "radian". |
add |
Indicates if the plot will be added to an existing rgl plot. |
... |
Additional items to be passed on to the rgl plotting function. |
This plotting function uses rgl plotting functions to produce a new 3D plot, or to add to an existing 3D plot. Plotting parameters will be passed on the the plot3d() function for customization. The stationary "body frame" which uses the "North-East-Down" (NED) frame of reference is plotted using the color red. Each of the three axes is plotted with small spheres on the end. The X-axis points posterior to anterior (i.e. direction the animal is facing) and faces north when not rotated. The Y-axis is oriented to the east of the X-axis (points left to right). The Z-axis is the dorso-ventral axis and points downward when not rotated (toward the center of the Earth). The rotated axes are also plotted in blue. The X-axis is given a large sphere so that it is easy to represent the direction that the animal is facing.
An object with two rotated matrices
rotmat |
3x3 rotation matrix |
hrotmat |
homogenous rotation matrix |
Ed Farrell <edward.farrell27@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 | ## Animal with a roll angle of 30 degrees, and a pitch angle of 10 degrees
roll <- 30
pitch <- 10
yaw <- 0
animalplot3d(roll,pitch,yaw,angle = "degree")
## Make the plot a bit larger
par3d(windowRect = c(50,50,700,700))
## Add another animal orientation with the same roll and pitch, but a 40 degree yaw.
animalplot3d(roll,pitch,40,angle = "degree", add=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.