Ist it possible to interactively visualize 3D orientation vectors with Plotly?

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.

Is it possible to do this with Plotly?

Hi @johann.petrak,

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.

Animation of this is something different, though.

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?

Yes, give me some time to search that In my archive :rofl: @johann.petrak

1 Like

Hey @johann.petrak, that was faster than I thought:

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.

1 Like

Very cool, thank you!

1 Like