Panda3D手册:Panda3D 导言

Panda3D Basics

Panda3D 基础

Panda3D is a 3D engine: a library of subroutines for 3D rendering and game development. The library is C++ with a set of Python bindings. Game development with Panda3D usually consists of writing a Python or C++ program that controls the Panda3D library.
Panda3D 是一个 3D 引擎:一个 3D 渲染和游戏开发库。这个库和 C++ 或 Python 绑定。用 Panda3D 开发游戏时要通过 C++ 或 Python 调用 Panda3D 库。

Panda3D 是一个 3D 引擎:一个 3D 渲染和游戏开发库。这个库和 C++ 或 Python 绑定。用 Panda3D 开发游戏时要通过 C++ 或 Python 调用 Panda3D 库。

Panda was created for commercial game development, and its primary usersare still commercial game developers. Because of this, Panda3D needsto emphasize four areas: power, speed, completeness,and error tolerance. Everyone knows what power and speedare. But completeness and error tolerance deserve some extra commentary.
Panda 是为商业游戏的开发而生的,他的主要用户依然是商业用户。正因如此,Panda3D 强调四个方面:能力、速度、完整性和容错。大家都知道什么是能力和速度。我们对完整性和容错简单的介绍一下。

Completeness means that Panda3D contains tons of unexciting but essentialtools: scene graph browsing, performance monitoring, animation optimizers,and so forth. These things may not be sexy,and as a result, open-source engines often don't have them. But whenyou're serious about getting work done, and not just playing, thesetools need to be there.
完整性的意思是 Panda3D 包含及其枯燥的但重要的工具:场景浏览器、性能监视器、动画优化器等等。这些东西并不“性感”,所以,许多开源的引擎并不包含这些杂七杂八的东西。但是你要是真的想完成工作,而不是用它来玩玩,你就需要这些工具了。

Error tolerance is about the fact that all game developers create bugs.When you do, you want your engine to give you a clear error messageand help you find the mistake. Too many engines will just crash ifyou pass the wrong value to a function. Panda3D almost never crashes,and much code is dedicated to the problem of tracking and isolatingerrors.
容错是针对游戏开发中的错误。当错误出现时,您希望引擎能给您一个明确的错误信息来帮助您找出错误。但是许多游戏引擎当你在向函数传递错误的参数之后会直接崩溃。Panda3D 几乎从不崩溃,有很多代码是专用于跟踪和分析错误信息的。

Finally, to come back to power and speed: the best way to gauge Panda3D'scapabilities is to take a look at the Sample Programs. These areshort programs that demonstrate a sampling of Panda3D's capabilities.The screenshots have frame-rates in the upper-right corner, taken ona Radeon X700.
最后,回来谈谈能力和速度:测试 Panda3D 性能的最好的方法就是看看这组示例程序。这组简单的演示程序测试了 Panda3D 的特性。画面的右上角显示了帧数,这些数据是在Radeon X700显卡下得出的。

Panda3D was developed by Disney for their massively multiplayer online game, Toontown. It was released as free software in 2002. Panda3D is now developed jointly by Disney and Carnegie Mellon University's Entertainment Technology Center.
Panda3D 是由迪士尼的大型网络游戏《Toontown》发展而来的。它是2002年发布的自由软件。现在已由迪士尼和卡耐基梅隆大学娱乐技术中心共同进行开发。

You can read more about Panda3D's Features.
想了解更多的相关信息请访问 Panda3D的特性。

Panda3D is not a Beginner's Tool or a Toy

Panda3D 不是初学者用的工具或是什么玩具

To successfully use Panda3D, you must be a skilled programmer. If you donot know what an "API" is, or if you don't know what a "tree" is, you will probably find Panda3D overwhelming. This is nopoint-and-click game-maker: this is a tool for professionals. While It is important to point that out so you have accurate expectations, it's also relevant to be aware that Panda3d is one of the easiest and most powerful engines you will ever use, and we welcome your participation.
要用好 Panda3D,您必须是一个熟练的程序员。如果您不知道是“API”,或者您不知道什么是“树”,您多半会发现 Panda3D 是非常难的。他不是靠单击鼠标就能制作出游戏的:这是一个为专业人员准备的工具!为了让你有一个心理准备,这点是必须指出的!不过,他也将是您用过的最简单的、最强大的引擎之一,欢迎您的加入。

If you are just getting started with programming, we suggest that your best option is to start with a class onprogramming. Alternately, you could try teaching yourself using a trainingtool like Alice, also from CMU. While on the discussion of tools, it should be noted here for reference that "Scene Editor' is a very useful tool for constructing components of your panda app and should you wish to consider trying them once you are comfortable with using panda, then you can find information about them in the manaul at section VIII: H .
如果您刚开始编程,我们建议您参加一个编程语言学习班。或者,您可以使用像 Alice 这样的工具来自学,或者用 CMU。现在聊聊工具,要注意,“场景编辑器”是一个 Panda 下对于建立程序组件非常有用的工具,当您对Panda3D熟悉起来之后,您应该尝试一下这些好用的工具,更多的信息请参见手册第VIII节的H部分。

Some people have seen screenshots of childrens' games written in Panda3D,and concluded that Panda3D is graphically limited. Not so.Developers of childrens' games often choose not to use shaders or other advanced graphics, because children often own older hand-me-downcomputers. But Panda3D supports the full range of what modern enginesshould: it provides convenient support for normal mapping, gloss mapping,HDR, cartoon shading and inking, bloom, and a number of other things.It also allows you to write your own shaders, making it capable ofanything.
好多人看到用 Panda3D 编写的儿童游戏截图后,会得出“Panda3D 的绘图功能不强”这么一个结论。不是这样的!用 Panda3D 编写儿童游戏时往往不会用着色器和其他的绘图功能,因为孩子们通常使用老得掉渣的计算机。但是 Panda3D 支持很多当代游戏所必须的特性:他支持法线贴图、光泽贴图、HDR、卡通渲染和线框渲染、bloom 和很多其他的模式。他也允许您自己写的着色器,这使得它能胜任各种各样的工作。

People sometimes have the mistaken impression that Panda3D is writtenin python, which would make it very slow. But Panda3D isnot written in python - it's written in C++. The python is just forscripting, developers usually write the performance-intensive bitsin C++. To see what kind of frameratea small Panda3D program typically gets, take a look at the screenshotsof the Sample Programs.Those were taken using a Radeon x700.Of course, only a sample program can run at 400fps like that, butbut for a real game, 60fps is quite attainable. One caveat, though:to get that kind of performance, you need to understand 3D cards and3D performance optimization. It doesn't happen automatically. Panda3Dincludes profiling tools you need to hit 60fps.
人们经常错误的认为 Panda3D 是使用 python 写成的,如果是这样 Panda 会非常地慢。但是 Panda3D 不是用 python 写成的——它是用 C++ 写的。python 仅仅负责脚本部分,而对性能要求相当高的部分由 C++ 写就。看一看演示程序的截图就能知道小型 Panda3D 程序的帧率如何(令人汗颜的500+帧/秒)。这里是用的是 Radeon x700 显卡。当然,运行简单的程序能够达到 400fps 的速率,运行真正的游戏也能达到 60fps 左右。注意,要想获得好的性能,您需要了解 3D 显卡和 3D 性能优化。往往不是你写完程序它就有 60fps 的。Panda3D 的分析工具能帮您获得 60fps 的速率。

Panda3D's Software License

Panda3D 的软件协议

Since version 1.5.3, Panda3D has been released under the so-called "Modified BSD license," which is a free software license with very few restrictions on usage. In versions 1.5.2 and before, it used a proprietary license which was very similar in intention to the BSD and MIT licenses, though there was some disagreement about the freeness of two of the clauses. The old license can still be accessed here.
到了 1.5.3 版时,Panda3D 已经使用“改进后的BSD协议”,这是一个限制非常少的自由软件协议。在 1.5.3 版和后续版本中,使用的授权协议很像 BSD 协议和 MIT 协议,虽然两者对于免费的解释有所不同。使用旧协议的版本的库在这里也可以得到。

Although the engine itself is completely free, it comes with various third-party libraries that are not free software. Some of them (like FMOD) even restrict you from using it in commercial games, unless you have a licensed copy of FMOD. Because of this reason, Panda3D makes it easy to disable or remove these restricted thirdparty libraries, and most of the time it offers an alternative. For example, instead of FMOD it also comes with OpenAL which you can use instead.
尽管这个引擎本身是完全免费的,他的第三方库却不是免费的。其中的某些部分(比如FMOD)是不允许用在商业游戏上的,除非您有 FMOD 的授权。因为这些原因,Panda3D 提供了禁用这些第三方库的方法,大部分库都有替代方案。比如,可以用 OpenAL 替代 FMOD 。

You can read Panda3D's License.
您可以在这里找到 Panda3D的协议

Who is Working on Panda3D

哪些人在维护 Panda3D

There are a number of developers in the commercial and open-source community. Currently, the two most active members of the development community are Disney and the Entertainment Technology Center at Carnegie Mellon. Because both organizations have specific goals, Panda3D must necessarily serve both:
许多公司和开源团体的程序员在维护panda。目前,最活跃的两个社区是迪士尼和卡耐基梅隆娱乐技术中心。因为这两个团体有明确的目标,所以 Panda3D 一定注重:

  • Disney's primary interest in Panda3D is commercial. Panda3D is being used in the development of a number of Disney games and amusement-park exhibits. To serve Disney's needs, Panda3D must be a fully-featured engine, capable of all the performance and quality one expects in any 'A-grade' commercial title.
    迪士尼对 Panda3D 的开发是“商业性”的(亦即它会被用到一个商业游戏里面)。Panda3D 是迪士尼一直用于游戏开发和主题公园展示的引擎。为配合迪士尼的需要,Panda3D 必须是一个全能的引擎,在所有的性能指标上都要达到商业上的“A级”标准。
  • The Entertainment Technology Center's primary goal is education. To serve the Entertainment Technology Center's needs, Panda3D must be well-suited for use in student projects. Since students have a unique talent for causing crashes, bulletproof reliability is needed. Since projects only last one semester, the learning curve must be very short, and prototyping must be very rapid.
    娱乐技术中心一开始的目标是教学。为满足媒体中心的需要,Panda3D 必须非常适合教学。由于学生们总是有某种特殊的“天赋”能使引擎崩溃,所以引擎具有“金钟罩,铁布衫”式的稳定性就是必需的。由于工程只会持续一个学期,学习的曲线就必须尽可能地短,并且需要尽可能地迅速地写出一个游戏原型。

As it turns out, the two sets of goals are complementary. The rapid development and high reliability needed by the Entertainment Technology Center are also highly advantageous in a game-development studio, since they lower development time and costs. The good visual quality and full feature set needed by Disney to make a professional-quality game also turn out to be useful in a university setting: with a broad range of features at their disposal, students can explore their creativity more fully than they could with a more limited engine.
事实证明,这两个目标相得益彰。娱乐技术中心所需要的迅速的开发以及超高的稳定性在游戏开发工作室里面也是必要的,因为他们可以降低开发的时间与成本。迪士尼所需要的出色的视觉效果和完善的功能也是大学的课程所必需的——有了它完善的功能和各种特性,学生们可以更好地开发他们的创造力。

The most supported language is Python. Though you can use C++ too, the documentation is mostly aimed at Python use.
支持最好的语言是 Python。尽管您也可以用 C++,这个文档更针对于 Python 用户。

The Introductory Chapter

前言

This introductory chapter of the manual is designed to walk you throughsome of the basics of using Panda3D. This chapter is structured as atutorial, not as a reference work.
这本手册的前言介绍一些 Panda3D 的基本知识。这一章的行文思路更多地像一个教程,而不像一个参考手册。

原译:NoIE
校订:西瓜玩偶