pygame to panda3d

Is it possible to have pygame draw to a surface, and then convert that surface to a texture in panda3d? What would be involved in order to do that?


It is possible but hard. You would have to rewrite pygame (SDL) as an extension for panda. OR you could also implement a pygame like library to mimics pygame functionality on top of panda. OR the best method of all is to just learn panda3d.

Your question is more like can i use my Ferrari as truck and the answer is yes if you figure out how to attach a trailer to it… but why would you want to do that?

I think it would be easier to just use panda for the 2D rendering. To see how to do that, take a look at the Asteroids sample program and the Render-to-Texture sample program — you could combine them into a render-Asteroids-into-a-texture sample.

Hm, I don’t know, but can you safe pygame surfaces as textures to disk?
If so, you could load that texture file into panda like any other textuer… that is if you really insist on using pyGame to manipulate textures. Thats the easiest way I can think of to integrate pyGame with Panda… but there might be other simple ways (apart from rewriting any modules) to do it.

well i dont know about pygame but i know that sdl can write sdl-surfaces as bmp images to disk. since pygame is a python wrapper for sdl it should be possible. but like other already said. it’s propably easyer to just let panda do the texturing. panda has a number of operations on textures which are very simmilar to the ones used in SDL and therefore pygame.