pyopengl:它可以取代 C++ 吗? [英] pyopengl: Could it replace c++?

查看:38
本文介绍了pyopengl:它可以取代 C++ 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开始一门计算机图形课程,我必须选择一种语言.

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

选择在 C++ 和 Python 之间.我对 C++ 没有问题,python 正在进行中.所以我想走 python 路,使用 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.

python/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.

推荐答案

这在很大程度上取决于您的计算机图形课程的内容.如果你正在做任何类似我过去教过的入门课程,它基本上是旋转立方体和球体,一些纹理映射和一些顶点动画,仅此而已.在这种情况下,Python 将完全足够,假设您可以绕过 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.

如果您想将自己的知识用于计算机图形领域的实际工作,几乎每个游戏和图形引擎都是用 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.

这篇关于pyopengl:它可以取代 C++ 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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