10

I have a 3d model that consists of points, lines and balls in space. For debugging, it would be nice to render these objects in real time and rotateable.

What are my easiest options to achieve this in python? Since I know nothing about graphical programming, I'd like to write as litte boilerplate code as possible.

3 Answers 3

5

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

0
4

Two options I'd consider myself (depends what you're trying to do in the end):

  • Blender has fairly amazing Python integration. Simple example here. As I understand it, Blender's own file save format is executable python which prods the Blender Python API to reconstruct the scene. There's also a mechanism for introducing gamey logic into the Blender world but I know even little about it. Blender does have a crazy steep learning curve though.

  • Get into OpenGL using the Python OpenGL bindings. "Simple" example.

If you're more interested in creating the models, go with the former; if you're more interested in the rendering of them, go with the latter.

0

The first thing that springs to mind is processing which is an easy to use visualization toolkit. Although you actually implement your visualizations in java, a quick google found this which lets you write your sketches in python instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.