python 3D visualization and graphics

CodeKingPlusPlus picture CodeKingPlusPlus · Aug 2, 2013 · Viewed 73.6k times · Source

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

Answer

tom10 picture tom10 · Aug 3, 2013

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.