We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(8)
Panda3D 是一个漂亮、强大的游戏引擎,允许使用 Python 编写脚本。这看起来是一个很好的起点。
如果您寻求更底层的东西,仍然可以使用 PyOpenGL 或 PyOpenGL 。 pygame.org/news.html" rel="noreferrer">pygame。
Panda3D is a nice, powerful game engine which allows for scripting in Python. This looks like a good place to start.
If you seek something more low-level, there's still PyOpenGL or pygame.
有 Pygame: Python 语言的游戏框架。如果您需要了解游戏开发的基础知识(引擎、流程、用户界面、数学),这个框架及其所有示例将对您有很大帮助。这不会引导您逐步完成游戏开发,但如果您需要参考和像样的框架,那么这是一个好的开始。
还有 PyOpenGL:用于 OpenGL 编程的官方 Python 包装器。再次提供大量现场编程示例以及大量有关如何使用 3D 模型等的代码片段。可以与PyGame一起使用。
但是您应该首先熟悉一些 3D 基础知识。浏览 GameDev.net 站点。了解一两件事关于矩阵(也许还有四元数)。有很多初学者教程和参考资料可帮助您入门。
编辑:我差点忘了:还有 Panda3D ,具有广泛的 Python 脚本编写可能性。也许这会提供更高水平的游戏开发。
There's Pygame: A game framework for the Python language. If you need to know the basics for game development (engine, flow, ui, mathematics), this framework with all its examples will help you a lot. This won't take you by the hand and guide you step by step through game-development, but if you need a reference and a decent framework, than this is a good start.
There's also PyOpenGL: The official Python wrapper for OpenGL programming. Again with lots of programming examples in the field and tons of code snippets on how to use 3d models and the likes. Can be used together with PyGame.
But you should start by familiarizing yourself with some 3D basics. Look around at the GameDev.net site. Learn a thing or two about matrices (and perhaps quaternions). There are lots of beginners tutorials and references available to get you started.
edit: I almost forgot: there's also Panda3D with extensive scripting possibilities for Python. Maybe that'll offer a higher level of game development.
实际上,您可以通过 Python 在 Blender 中开发游戏。教程有很多,我让你google一下,找到你喜欢的风格。
更多信息此处
You can actually develop games in Blender via Python. There are quite a few tutorials, I'll let you google around for the style you like.
More info here
我个人更喜欢 PyGame 的替代品是 pyglet。
http://pyglet.org
An alternative to PyGame, which I personally prefer, is pyglet.
http://pyglet.org
如果您想编写 3D 游戏,您可能需要首先了解编程和计算机科学的基础知识。从顶部开始学习一门语言,然后给自己找一个好的图形库,例如 Panda、Pygame 都是不错的选择,然后还有其他部分需要考虑,例如与twisted 的网络或物理引擎。考虑使用像虚幻引擎这样的工作引擎也可能是一个不错的选择,因为游戏设计师常常过于专注于游戏机制而不是游戏本身
If you want to write a 3D game you might want to start by understanding the basics of programming and computer science. Starting with the top and learning a language, then find yourself a good graphics library for example Panda, Pygame are all good choices, then there are other parts to consider like networking with twisted for example or a physics engine. It might also be a good choice to consider using a working engine like the unreal engine as often game designers get too wrapped up in game mechanics and not the game itself
您应该知道,3D 游戏由
游戏逻辑和机械部分通常是最大、最复杂的部分,你应该首先尝试解决这个问题。
之后,对 3D 对象和环境进行建模应该会容易得多。
You should be aware that 3D game consists of
The game logic and mechanics is going to usually the biggest and most complicated part and you should try to wrap your head against that first.
Modeling 3D objects and environment should be much easier after that.
我会将时间关键的东西实现为 3D 及其对象处理+原始 C/C++ 渲染,并让带有外部模块的嵌入式 Python 处理游戏逻辑(对象移动、对象属性、脚本等)。
I would implement the time-critical stuff as 3D and its object handling + rendering in raw C/C++ and let an embedded Python with external modules handle the game logic (object movement, object properties, scripting and so on).
编写简单的 3D 游戏非常容易。屏幕上任何对象的位置始终可以简单地计算为:
其中
x
和z
都是水平轴,fov
是玩家的坐标轴视野,单位为[弧度/度/像素/...]。当你旋转时,这个词在旋转,而不是你。这意味着你总是在寻找正 z 的对立面。
四元数是围绕你旋转世界的最佳方式。
诗。使用 vertexarrays 或数组获得最快的 3D 图形
It's quit easy to code simple 3D games. The position of any object on the screen can always be calculated as simply as:
where
x
andz
are both horizontal axis andfov
is the player's field of view, in [radians/degrees/pixels/...].When you rotate around, the word is rotating not you. It means that you are always looking against positive z.
Quaternions is the best way to rotate the world around you.
Ps. use vertexarrays or arrays to for the fastest possible 3d graphics