Reputation: 337
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.
Upvotes: 10
Views: 20583
Reputation: 24892
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.
Upvotes: 4
Reputation: 5765
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.
Upvotes: 5
Reputation: 1619
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.
Upvotes: 0