Realtime Data Display

I wanted to share because I think it’s really cool that the flexibility of panda3d allows for doing basically anything!

This is a 2D game window where I’m plotting data from an embedded IMU through a USB serial port and making a realtime plot which is scrolling across the screen. I tried this with matplotlib first it was sooooo slooooow. Panda3D is superfast and looks amazing while doing it!

Next up: somehow get renderpipeline to work for the main project :upside_down_face:

5 Likes

Would love to see what techniques in Panda 3D that you used to do this!

Pretty simple, creating an array of position values from the serial port data, once the array is full we remove the oldest value to make room for the new values.

The entire graph is drawn every frame.

Using LineSegs() to draw the lines point by point with draw_to() and use them to create geoms and render with aspect2D.

This is where the magic happens, where the lines are used to generate the geoms.

self.accel_x_node.node().remove_all_geoms()
self.accel_x_node.node().add_geom(self.accel_x_lines.create().modify_geom(0))

1 Like

Thank you!

No problem!
Let me know if you have any more questions!