简体   繁体   English

有pyglet所有opengl技能和支持3D?

[英]have pyglet all opengl skills and support 3d?

i want to start to learning 3d programming in python 我想开始学习python中的3d编程

i found pyopengl for use opengl in python and i found pyglet and i like that because says "No external dependencies" and i heard this is better for make something like game engine or game and etc. 我发现pyopengl在python中使用opengl,我发现pyglet,我喜欢它,因为说“没有外部依赖”,我听说这对于制作游戏引擎或游戏等等更好。

but i have a problem i can't find any 3d example of pyglet and i read some say : pyglet is good 2d this like pygame and ....., and on the other side some say, this is good opengl framework for just 2d another say just 3d and ...... 但我有一个问题我找不到pyglet的任何3d例子,我读了一些说:pyglet很好2d这个像pygame和.....,而另一方面有人说,这是很好的opengl框架只是2d另一个说只是3d和......

now i want to know is really pyglet have all opengl skills for use in 3d game engine or make a 3d game or not pyglet only for 2d work and nothing more if this i should go to pyopengl for my work 现在我想知道是非常pyglet有所有opengl技能用于3D游戏引擎或制作3D游戏或不做pyglet只为2d工作,没有更多如果我应该去pyopengl我的工作

thanks a lot 非常感谢

I believe you're asking whether pyglet has complete bindings for OpenGL or not. 我相信你问的是pyglet是否有完整的OpenGL绑定。

In the documentation, The OpenGL interface says yes: 在文档中, OpenGL界面说是:

pyglet provides an interface to OpenGL and GLU… You can access this interface directly; pyglet为OpenGL和GLU提供了一个接口......你可以直接访问这个接口; using it is much like using OpenGL from C… The interface is a "thin-wrapper" around [OpenGL]… it is always up-to-date with the latest version and almost all extensions. 使用它就像使用C语言中的OpenGL ...界面是[OpenGL]的“瘦包装”......它始终与最新版本和几乎所有扩展保持同步。

However, as that page warns, the wrapper is very thin, and "you will need a good knowledge of OpenGL, C and ctypes." 但是,当该页面发出警告时,包装器非常薄,“你需要熟悉OpenGL,C和ctypes。” If that's a problem: 如果这是一个问题:

You may prefer to use … PyOpenGL. 您可能更喜欢使用... PyOpenGL。 PyOpenGL provides similar functionality with a more "Pythonic" interface, and will work with pyglet without any modification. PyOpenGL提供了类似的功能和更“Pythonic”的接口,并且可以在没有任何修改的情况下使用pyglet。


So, you have two choices: 所以,你有两个选择:

  • Use just pyglet , if you understand (and like) OpenGL and C-style interfaces. 如果你理解(和喜欢)OpenGL和C风格的接口,请使用pyglet
  • Use pyglet and PyOpenGL together if you prefer nicer interfaces to OpenGL. 如果您喜欢更好的OpenGL接口,请同时使用pygletPyOpenGL

Either way, you will have full access to all of the power of OpenGL. 无论哪种方式,您都可以完全访问OpenGL的所有功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM