python 3D visualization and graphics [closed]

試著忘記壹切 提交于 2019-11-30 04:54:49

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.

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.

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