python 3D visualization and graphics [closed]

寵の児 提交于 2019-11-30 12:35:26

问题


I am looking for Python compatible 3D graphics. Mostly I would like to be able to draw lines and view them in 3D. I literally have no experience in this area and am looking for knowledge and tutorials.

I learn programming best by experimentation. So which packages do I need to do 3-D graphics? I really enjoy using emacs, so if you have those suggestions as well that would be awesome!

In summary:

  1. Which packages do I need for 3D graphics in python.
  2. Note that I use Ubuntu 12.04 LTS and emacs 24.3

回答1:


EDIT

My answer below is for those who are interested in realtime graphics. If you just need to draw a 3D graph and periodically update it, something like gnuplot may be more appropriate.

Also see Tom's answer below.

ORIGINAL

The most common way to integrate realtime 3D graphics is using the OpenGL library. OpenGL and realtime graphics is a big topic, but focusing on something like drawing 3D lines should not be too difficult. Bindings exist for python http://pyopengl.sourceforge.net/

GLUT - is probably the best for providing X platform windowing and context setup, and is included in the mentioned bindings.

OpenGL - there are several versions, for your application, immediate mode, legacy, is probably acceptable.

Here are some links for learning - Don't feel obligated to read them all - pick the topics that are relevant to you.

  • http://greendalecs.wordpress.com/2012/04/21/3d-programming-in-python-part-1/
  • http://www.informit.com/articles/article.aspx?p=328646&seqNum=6
  • http://www.videotutorialsrock.com/
  • http://nehe.gamedev.net/ (legacy)



回答2:


The easiest way for 3D visualization in Python is VPython.

For example, to draw a curve in the shape of a square, it's just:

square = curve(pos=[(0,0),(0,1),(1,1),(1,0),(0,0)])

This is vastly easier than MayaVI, VTK, OpenGL, etc.

Another easy option is matplotlib's 3D graphics. It's better on the quantitative details, but not as simple, fast, and interactive for the 3D part.



来源:https://stackoverflow.com/questions/18026134/python-3d-visualization-and-graphics

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!