I’ve only been using Panda3D for a few months, but it’s great. It really helps me to display my data.
I would like to display an image with OnScreenImage. My data is already stored in a numpy array. I tried with a PNMImage but I have to save it in a file to be able to give it to OnScreenImage which is not satisfactory.
I create the image like this
myEmptyImage = PNMImage(256, 256)
and try to use it like this
self.image = OnscreenImage(image=myEmptyImage,pos=(-0.5, 0, 0.02), parent=aspect2d)
but it does not work. Error about an empty image.
I have to save it and reload it like this:
self.image = OnscreenImage(image=“test.png”,pos=(-0.5, 0, 0.02), parent=aspect2d, scale=(0.2,0.2, 0.2))
Passing my data from numpy to PNMImage is not a problem.
My problem is to pass it to OnScreenImage without having to save it into a file.