What are some good libraries for creating a python program for (visually appealing) 3D modeling / visualization of physics?

What are some good libraries for creating a python program for (visually appealing) 3D modeling / visualization of physics?

I looked at Vpython, but the simulations I saw look ugly, I want them to be visually appealing. It also looks like an old library. For 3D programming, I saw suggestions for using Panda3D and python-ogre, but I'm not sure if it is really suitable for accurate modeling. Also, I would prefer a library that mixes well with other libraries (e.g. pygame doesn't mix well with other libraries).

+4
source share
4 answers

3D support for python is rather weak compared to other languages, but with the fact that most of them are built, the appearance of the program is much more volatile than you think. For example, you talked about Vpython, while many of their examples are not visually appealing, most of them also relate to previous releases, the latest release includes both extrusions, materials, and skins that allow you to customize the look much more than before.

Perhaps it is worth noting that in real time it is simply impossible to make images with rendering quality (loops are a huge step in this direction, but it is still not quite there). I believe that most of your problem here is that you are looking for something that the technology is simply not able to now, however, if you are willing to take the burden so that your simulation looks visually appealing, Vpython (which is a complex version of PyOpenGL) is probably your best bet. The following is a list of different technologies, though if you are looking for something more general:

Blender: the most powerful graphical program for python is available, however it is intended for graphic design and special effects, although it has very complex physics working under it, Blender is not intended for physical modeling. Independently.

Panda3D: The program is very often compared to Blender, but mostly useful for games. The game engine works better than Blender, but the rendering quality is much lower, as well as multifunctionality. Independent

Ogre: A library that was very popular for game development in those days, with many powerful features, especially for creating gaming environments. Event handling is also very well implemented. Can be done to integrate with other libraries, but with difficulty.

VPython: A library designed for physical simulations that removes a lot of texture mapping and rendering compared to other methods, however this option still exists because VPython is mainly built from OpenGL, which is one of the most versatile graphics libraries. Thus, VPython also integrates very easily with other libraries.

PyOpenGL: OpenGL for Python. OpenGL is one of the most widely used graphic libraries and, without a doubt, is able to create some of the most enjoyable visual effects on this list (except for Blender, which is its own class), however, this will not be easy, PyOpenGL are very bare bones, and although the functionality is there, it will be harder to implement than anything else. He plays a lot with other libraries, but only if you know what you are doing.

+4
source

Try PyOpenGL . This is a library that provides Python bindings to OpenGL through the Python ctypes library.

Here is a demonstration of this:

PyOpenGL baseball demo

+2
source

If I need a visualization package for python, I would start with Processing.py: https://github.com/jdf/processing.py

This is a python bunch for Processing.org java codes. A quick comparison can be found here: http://wiki.processing.org/w/Python_Comparison

Of course, if you are not limited to python, then the processing itself will also be a good starting point: http://processing.org

There are also python bindings for visualization toolkit (VTK), but most of their examples are C ++ or Tk.

If all you are looking for is a scene graph to move the geometries around, rather than native vis, then I saw some python bindings for the Open Scene Graph there, for example: http://code.google.com/p/osgswig/

Good luck

+2
source

From your question it is not clear what you want to achieve. Do you want to create a standalone application that can be used to control simulation at runtime, or create a simulation using Python, which can then be viewed offline?

For the latter, you can look at Blender , an open source 3D content creation kit that includes a python scripting interface that provides access to most (if not all) of the applicationโ€™s internal components. Blender comes with some physics and particle libraries that may be useful, and how the application points to the type of software used to create visual effects for movies, etc.

If you want to make a standalone runtime simulation management application, this is most likely not suitable. However, if you want to create a series of visible images, it might be worth a look.

0
source

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


All Articles