开发者

3d Drawing in Python with OpenGL

I need to:

  • draw 3d models with specific 3ds tex开发者_开发百科tures
  • have the models be moving (just position)
  • have a camera viewer which is easily maneuverable (ideally in real time)

I would like to accomplish this with Python and OpenGL. What would be the best libraries to accomplish this and what are some good resources to read up on?

Thanks in advance!


I recommend python-ogre for this. It abstracts away keyboard, mouse, windowing, OpenGL and with some additional extension you can even get sound and physics. I have a fairly sophisticated 3D project that I have been writing with OGRE so I can attest to its ease of use. The tutorial apps and examples are enough to do what you described here. There are also exporters for all the major 3D modeling packages so you can export models to a format that is acceptable for OGRE. It's very mature and stable at this point as well, and the community is large.


While I usually dislike answers that point to other technologies than the ones asked, I will bedoing that here.

As you might have seen, googling for Python OpenGL will yield a host of options. From raw unmaintained hard-to install bindings, to higer level 3D libraries that still allow low level OpenGL calls.

I am no 3D man -but I will recomend you to use Blender 3D. (http://www.blender.org/) - it is a full featured 3D modeling + animation + presentation software, scriptable and controlable with Python. Wiithin it, you will have the camera viewer feature ready to use in the presentation mode (called "Game Engine") , there are python scripts to import 3ds files, yo can move the models either programatically from python or with the logic blocks - and yes, it eve allows you to do low level OpenGL calls :-) (so it is not that out of the way).

I think it will have everything you want, and it willbe far easier to get there than scripting everything from the ground up.


Either pyOpengl or Qt and the QopenGL widget

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜