I am designing a Tkinter app in Python that uses the Panda3D game library to display some 3D models. With my current design, I run the Panda3D engine in headless mode with the option windowType='offscreen', and I periodically take screenshots from the headless window and display them in a Tkinter Canvas widget. However, this view does not have any of the interactive features of Panda3D.
I am using Panda3D version 1.10.13.post1.
Is there a way that I could embed the Panda3D window in Tkinter, so that it could be an interactive 3D view?
Based on example code from https://discourse.panda3d.org/t/an-example-of-panda3d-integration-into-tkinter/28329, as suggested by user acw1668, I got a Panda3D window to run in a Tkinter app.
Screenshot: PNG
Note: I had to run
pip install Pmwfor this to work, which I believe is an unlisted dependency of Panda3D.