I have a dataset that contains 13 cameras, each camera location was reconstructed 5 times. I have aggregated the measurements into a mean and standard deviation for each the 6 variables that relate to the position of the camera [X, Y, Z, Omega, Phi, Kappa]. I would like to plot the positions of the cameras based on the XYZ mean values but then create an ellipsoid for each location based on the standard deviation values for each of the XYZ values. (like an error bar, which would also be acceptable but my first goal is to create colorized ellipsoids showing the directions of greatest variance or error... for this example I am using the standard deviation value.)
I am using rgl
to plot the mean position of each camera but I am not sure how to change the shape of each plotted point by the values from another vector or column.
The position data is aggregated to the mean values here
pos.mean
PhotoID X Y Z
DSC_7120 -269.697307 -359.608029 2390.520
DSC_7121 -323.537075 -312.080524 2388.374
DSC_7122 -381.084880 -259.807930 2386.175
DSC_7123 -434.500687 -212.438305 2384.080
DSC_7707 -297.275547 -12.954589 2352.626
DSC_7708 -238.105775 -61.327624 2353.830
DSC_7709 -178.910977 -110.464992 2354.912
DSC_7710 -124.471751 -155.745775 2356.300
DSC_7711 -65.107734 -205.164167 2358.239
DSC_7794 -2.828331 9.167357 2308.687
DSC_7795 -61.841640 56.621020 2307.068
DSC_7796 -118.768896 104.237722 2306.107
DSC_7797 -176.829418 150.560971 2304.887
and the standard deviation values are:
pos.sd
PhotoID X Y Z
DSC_7120 0.1507733 0.3651178 0.0018517456
DSC_7121 0.1508845 0.3633876 0.0005815413
DSC_7122 0.1512489 0.3671259 0.0021316858
DSC_7123 0.1498382 0.3667440 0.0050629647
DSC_7707 0.1495099 0.3600409 0.0016483624
DSC_7708 0.1470677 0.3583582 0.0014911045
DSC_7709 0.1458569 0.3596208 0.0021194229
DSC_7710 0.1396953 0.3604535 0.0033336396
DSC_7711 0.1414401 0.3620422 0.0047287867
DSC_7794 0.1442061 0.3691425 0.0056096078
DSC_7795 0.1516369 0.3688717 0.0016928413
DSC_7796 0.1565440 0.3672701 0.0038089509
DSC_7797 0.1547617 0.3726132 0.0079183205
The basic 3D plot currently can be viewed as such
library(rgl)
with(smry.mean,
plot3d(X, Y, Z,
type="s"))
Is there a way to change the points into colorized ellipsoids where the dimensions and color of the ellipsoids is built from the standard deviation values for each point?
Thank you