Renderer for a 3D model (points / lines) in Python

I have a 3D model consisting of points, lines and balls in space. For debugging, it would be nice to visualize these objects in real time and rotate.

What are my easiest options to achieve this in python? Since I know nothing about graphical programming, I would like to write as a litte template template as much as possible.

+6
source share
3 answers

The easiest way to get 3d graphics on the screen in python is VPython , although if your model is stored in a CAD file format, you will need another library to load the data. With just VPython, you have to either hard-code the model or implement your own loader.

+4
source

Two options I could think of (depending on what you are trying to do at the end):

  • The blender has pretty amazing Python integration. A simple example is here . As I understand it, the Blender file save format is python executable that supports the Blender Python API for scene recovery. There is also a mechanism for introducing game logic into the world of Blender, but I know little about it. The blender really has a crazy steep learning curve.

  • Log in to OpenGL using the Python OpenGL bindings. A "simple" example .

If you are more interested in creating models, check out the first; if you are more interested in rendering them, skip to the latter.

+2
source

The first thing that comes to mind is processing , which is an easy-to-use visualization tool. Although you do implement your visualizations in java, a quick google has found this one that allows you to write your sketches in python.

0
source

Source: https://habr.com/ru/post/887396/


All Articles