How would I import blender models into Python/Pygame?

Hi,

Is it possible for me to import blender models into Python/Pygame and make them usable (i.e. rotate a blender model by pressing the left, right, up, and down arrows)?

Thanks! :slight_smile:

Pygame is a 2d library. It has no support for displaying 3d objects. You’ll have to use PyOpenGL. Then you could try to find Python libraries to import 3d meshes.

I would rather go straight into Ogre Python, as this is the Python version of Ogre, a powerful open source 3d game engine. Quite technical though.

As piichan said, PyOpenGL or PyOgre would probably be best, but there is also pyglet which I is somewhat a cross between PyOpenGL and Pygame (its not affiliated with either of those, though).

If you’re looking for a “cheap” way of doing 3D in pygame, you can always render out turnarounds of your objects and use them as sprites. You can then switch out the sprites when you press the proper key. Its not robust, and you’re limited to the turning resolution of your pre-rendered sprites, but it could work in a pinch.