什么是为(视觉上吸引人的)3D 物理模拟/可视化创建 python 程序的好库? [英] What are good libraries for creating a python program for (visually appealing) 3D physics simulations/visualizations?

查看:27
本文介绍了什么是为(视觉上吸引人的)3D 物理模拟/可视化创建 python 程序的好库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为(视觉上吸引人的)3D 物理模拟/可视化创建 Python 程序有哪些好的库?

What are good libraries for creating a python program for (visually appealing) 3D physics simulations/visualizations?

我看过Vpython,但我看到的模拟看起来很丑,我希望它们在视觉上很吸引人.它看起来也像一个古老的图书馆.对于 3D 编程,我看到了使用 Panda3Dpython-ogre 的建议,但我不确定它是否真的适合精确模拟.另外,我更喜欢与其他库结合得很好的库(例如,pygame 与其他库结合得不好).

I've looked at Vpython but the simulations I have seen look ugly, I want them to be visually appealing. It also looks like an old library. For 3D programming I've seen suggestions of using Panda3D and python-ogre but I'm not sure if it is really suited for exact simulations. Also, I would prefer a library that combines well with other libraries (E.g. pygame does not combine so well with other libraries).

推荐答案

与其他语言相比,python 对 3D 的支持相当薄弱,但以它们中的大多数构建方式而言,程序的外观远比其他语言多变你可能认为.比如你谈到了 Vpython,虽然他们的很多例子在视觉上并不吸引人,但其中大部分也是来自以前的版本,最近的版本包括挤压、材料和皮肤,这使你可以自定义外观,而不是之前.

3D support for python is fairly weak compared to other languages, but with the way that most of them are built, the appearance of the program is far more mutable than you might think. For instance, you talked about Vpython, while many of their examples are not visually appealing, most of them are also from previous releases, the most recent release includes both extrusions, materials, and skins, which allow you to customize your appearance much moreso than before.

还可能值得注意的是,根本不可能实时制作渲染质量的图像(循环是朝着这个方向迈出的一大步,但还没有完全实现).我相信您在这里的大部分问题是您正在寻找技术现在根本无法实现的东西,但是如果您愿意承担使您的模拟看起来具有视觉吸引力的负担,Vpython(这是PyOpenGL) 可能是您最好的选择.不过,如果您正在寻找更通用的技术,以下是不同技术的概述:

It is probably worth noting also, that it is simply not possible to make render-quality images in real time (cycles is a huge step in that direction, but it's still not quite there). I believe that most of your issue here is you are looking for something that technology is simply not capable of now, however if you are willing to take on the burden for making your simulation look visually appealing, Vpython (which is a gussied up version of PyOpenGL) is probably your best bet. Below is a run down of different technologies though, in case you are looking for anything more general:

Blender:可用的最强大的 Python 图形程序,但是它是为图形设计和特殊效果而设计的,尽管它下面运行着非常复杂的物理,但 Blender 不是为物理模拟而设计的.自包含.

Blender: The most powerful python graphics program available, however it is made for graphic design and special effects, though it has very complex physics running underneath it, Blender is not made for physics simulations. Self contained.

Panda3D:一个经常与 Blender 相提并论的程序,但对游戏最有用.游戏引擎比 Blender 更好用,但渲染质量要低得多,功能丰富也是如此.自包含

Panda3D: A program very often compared to Blender, however mostly useful for games. The game engine is nicer to work with than Blender's, but the render quality is far lower, as is the feature-richness. Self contained

Ogre:一个在当时非常流行的游戏开发库,具有许多强大的功能,特别是用于创建游戏环境.事件处理也很好地实现.可以与其他库集成,但有困难.

Ogre: A library that was very popular for game development back in the day, with a lot of powerful functionality, especially for creating game environments. Event handling is also very well implemented. Can be made to integrate with other libraries, but with difficulty.

VPython:一个用于物理模拟的库,与其他方法相比,它消除了很多纹理映射和渲染能力,但是这种能力仍然存在,因为 VPython 主要是从 OpenGL 构建的,这是最通用的方法之一周围的图形库.因此,VPython 也很容易与其他库集成.

VPython: A library intended for physics simulations that removes a lot of the texture mapping and rendering power compared to the other methods, however this capability is still there, as VPython is largely built from OpenGL, which is one of the most versatile graphics libraries around. As such, VPython also is very easy to integrate with other libraries.

PyOpenGL:用于 Python 的 OpenGL.OpenGL 是使用最广泛的图形库之一,毫无疑问能够生成此列表中一些最好的视觉效果(Blender 除外,它是它自己的一个类),但是要做到这一点并不容易.PyOpenGL 非常简单,虽然功能已经存在,但它比其他任何东西都更难实现.与其他图书馆一起玩乐,但前提是您知道自己在做什么.

PyOpenGL: OpenGL for Python. OpenGL is one of the most widely use graphics libraries, and is without a doubt capable of producing some of the nicest visuals on this list (Except for Blender, which is a class of its own), however it will not be easy to do so. PyOpenGL is very bare bones, and while the functionality is there, it will be harder to implement than anything else. Plays very will with other libraries, but only if you know what you're doing.

这篇关于什么是为(视觉上吸引人的)3D 物理模拟/可视化创建 python 程序的好库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆