pyopengl:它可以取代C ++?它可以、pyopengl

由网友(温柔帅气小子)分享简介:我开始计算机图形当然,我必须选择一种语言。I'm starting a computer graphics course, and I have to choose a language.选择介于C ++和Python。我与C ++没有问题,蟒蛇是一项正在进行的工作。所以我想下井蟒之路,用pyopengl为显卡部分...

我开始计算机图形当然,我必须选择一种语言。

I'm starting a computer graphics course, and I have to choose a language.

选择介于C ++和Python。我与C ++没有问题,蟒蛇是一项正在进行的工作。所以我想下井蟒之路,用pyopengl为显卡部分。

Choices are between C++ and Python. I have no problem with C++, python is a work in progress. So i was thinking to go down the python road, using pyopengl for graphics part.

我听说虽然,性能是一个问题。

I have heard though, that performance is an issue.

时的蟒蛇/ pyopengl成熟到足以对性能挑战C ++?

Is python / pyopengl mature enough to challenge C++ on performance?

我意识到它是一个长镜头,但我想听听你对pyopengl的使用你的思想,经验。

I realize its a long shot, but I'd like to hear your thoughts, experiences on uses of pyopengl.

在此先感谢。

推荐答案

这在很大程度上取决于你的电脑制图课程的内容。如果你是做什么样的入门课,我教了过去,它基本上是旋转的立方体,球体,部分纹理贴图和顶点的一些动画,仅此而已。在这种情况下,巨蟒将是完全足够的,假设你可以围绕Unpythonic获得(和让说实话,非C ++)的OpenGL状态机的典范。

It depends a LOT on the contents of your computer graphics course. If you are doing anything like the introductory course I've taught in the past, it's basically spinning cubes and spheres, some texture mapping and some vertex animation, and that's about it. In this case, Python would be perfectly adequate, assuming you can get around the Unpythonic (and, lets be honest, un-C++) OpenGL state-machine paradigm.

有关的东西喜欢做你的矩阵数学,你可以使用numpy的,其核心是用C写的,是真是相当快。您将启动和运行速度更快,迭代更快,很可能有更多的乐趣。

For things like doing your matrix maths you can use Numpy, the core of which is written in C and is really quite quick. You'll be up and running faster, iterate faster and most likely have more fun.

然而,如果你正在做一些铁杆,切缘,数百万的三角形每一幕皮肤的动画,一切都电脑绘图过程中,坚持使用C ++。

If, however, you are doing some hardcore, cutting edge, millions-of-triangles-per-scene-skinned-animated-everything computer graphics course, stick with C++.

如果你的类提供给您的选择,它可能是一个安全的赌注,Python会好起来。

If your class has given you the choice it's probably a safe bet that Python will be ok.

如果你想利用你的知识转化为计算机图形学一个真正的工作,虽然,pretty的多每场比赛和图形引擎是用C或C ++,而Python(或LUA)留下作为脚本语言。

If you want to leverage your knowledge into a real job in computer graphics though, pretty much every game and graphics engine is written in C or C++, while Python (or Lua) is left as a scripting language.

阅读全文

相关推荐

最新文章