I would like to visualize the position and orientation of a moving object in 3D space over time. For this I want to draw the object’s own coordinate system unit vectors into a 3D plot at regular time intervals. The plot should look somewhat like this:
In this plot, for each position where the orientation is visualized the three unit vectors of the object coordinate system are drawn in red, green, blue.
The plot should be interactive, i.e. it should be possible to zoom, pan, rotate the camera.
Ideally the plot should also support animating the movement, i.e. animate how the orientation markers appear in the plot over time.
I created a function which creates coordinate systems a while back. It consisted of one 3d trace with three single lines corresponding to the system axes, the were actually red, green and blue.
I then added the coordinate system to the base 3d plot.
That sounds like what I should try, but how does one create the trace for plotting line segments in a 3D figure? Is there some example code for this somewhere?
You will need to address the duplicated legend entries (if you want to show the legend at all). There is also a scaling factor for the axes which is set to 1 right now. You might want to change that at some point.
At first look, this is what you are after- I think.