logo资料库

Ogre 3d 1.7 beginner Guide 中文版.pdf

第1页 / 共320页
第2页 / 共320页
第3页 / 共320页
第4页 / 共320页
第5页 / 共320页
第6页 / 共320页
第7页 / 共320页
第8页 / 共320页
资料共320页,剩余部分请下载后查看
About the Author 【有关作者】 Felix Kerger is a Computer Science student at the Technical University of Darmstadt and has been developing 3D real-time applications using Ogre 3D for more than five years. He has given several talks on software development and 3D real-time applications at different conferences and has been working for three years as an assistant researcher at the Fraunhofer Institute for Computer Graphics Research. He also works as a freelance journalist and reports yearly from the Game Developer Conference Europe.
【Felix Kerger 是达姆施塔特科技大学的一名主修计算机科学的学生。5 年多的时间里他一 直在采用 Ogre 3D 开发三维实时应用程序。他曾在不同的会议上发表一些关于软件开发和三 维实时应用程序的讲话,而且作为一名研究助理在弗劳恩霍夫计算机制图学研究所工作了 3 年。他也是一名自由撰稿人,每年都会为游戏开发者欧洲代表大会撰写报告。】 I would like to thank the following persons, without whom this book wouldn't have been possible: Steve Streeting for devoting so much time to Ogre 3D and creating one of the best pieces of software I have had the pleasure to work with; my former teachers Ms. Oppel and Ms. Michel, who helped me write a report on which this book's idea is based ; my parents, who were a constant source of inspiraton and motivation; Gregory Junker and Manuel Bua, my technical reviewers—their comments helped me no end and improved this book a lot; and, of course, the team at Packt for their constant help and advice. 【我要感谢以下各位,没有他们,这本书不可能写成:Steve Streeting,感谢他为 Ogre 3D 投 入那么多时间而且创作了堪称最好的软件之一,也是我很荣幸用到的软件;我曾经的老师 Oppel 和 Michel 女士,感谢她们的帮助,使我写成了为本书的精髓思想打基础的报告;我的 父母,感谢他们成为我灵感和动力的不竭源泉;Gregory Junker 和 Manuel Bua,我的技术评 审——他们不断提出建议帮助我,使本书得到了很大提高;当然,还有 Packt 团队,感谢他 们不断地帮助和提议。】 About the Reviewers 【有关评审】 Manuel Bua is a software and solutions architect from Trento, Italy. He has over 17 years' experience and has been involved in many small and large-scale software projects, at both the design and implementation levels. 【Manuel Bua 是一位来自意大利特兰托的软件和解决方案设计师。他有超过 17 年的经验并 且参加过很多大型和小型的软件项目,不论是设计还是实施水平层面的】 His background and experience range from software development to reverse engineering, embracing both the desktop and the mobile platform; multithreading, parallel, and massively-parallel computing architectures also pique his interest greatly, as well as computational photography and games development. 【他的背景和经历从软件开发延伸到逆向工程,包括桌面和移动平台;多线程,并行和大规 模并行高性能嵌入式计算也大大激发了他的兴趣,以及计算摄影学和游戏开发】 In 2007, he joined Jooce's Research and Development division in Paris, France, holding the positon of Chief Architect, engineering and optimizing their in-house, Actionscript-based virtual desktop platform connecting millions of people worldwide; during his staying, he also designed and implemented the compositing window manager governing windows transitions and effects, such as the well-known "Wobbly Windows," first introduced by Compiz on the (rocking!) Linux desktop. 【2007 年,他在法国巴黎参加了 Jooce 研究发展部,担任总设计师的职务,设计优化他们内 部基于 ActionScript 编程语言的虚拟桌面平台,连接世界各地成百上千的人;在此期间,他 还设计实现了一款合成窗口管理器,管理窗口过渡和效果,就像著名的“沃布利视窗”,初
步被在 Linux 桌面系统内(rocking!)的 Compiz 引入。】 He loves open standards and the open source culture. His desire to learn and to share his knowledge has led him to contribute to various projects, such as Ogre itself; he designed and programmed the original out-of-core implementation of what is known today as the "Compositor Framework," providing both the inital insight and the high-level concepts, laying the foundations for further research, work, and improvements. 【他热爱开放标准和开源文化。他对学习和分享知识的渴望引导他奉献于各种项目,例如 Ogre 本身;他设计编程了原始的外核心实现模式,也就是今天所知的“排字框架”,提供了 最初的洞察力和高层次的概念,为进一步的研究,工作和进步打下了基础】 He is currently employed at F4F Creative Factory, a design-inspired web and advertsing agency based in Arco, Trento, in the roles of solutions architect, software engineer, and systems administrator. 【他目前在 F4F 创意工厂工作,一个总部设在特兰托阿科公司的关于创作灵感的网站和广 告策划机构,担任着解决方案设计师,软件工程师和系统管理员的职务。】 Preface 【序言】 Creating 3D scenes and worlds is an interesting and challenging problem, but the results are hugely rewarding and the process to get there can be a lot of fun. This book is going to show you how you can create your own scenes and worlds with the help of Ogre 3D. Ogre 3D is one of the biggest open source 3D render engines and enables its users to create and interact freely with their scenes. 【创建 3D 影像世界是一个有趣并且充满挑战的问题,但其研究的效果很有回报性而且其探 索的过程会相当有趣。本书会向你展示如何用 Ogre3D 创造出属于你自己的场景和世界。Ogre 3D 是最大的开放源码三维渲染引擎中的其中之一,并且能够令使用它的人自由地创造和与 他们的场景进行交互。】 This book can't show all the details about Ogre 3D but rather provide a solid introducton with which you, as a reader, can start using Ogre 3D by yourself. After finishing the book, you will be able to use the documentation and the wiki to look up for the needed information and complex techniques, which aren't covered in this book. 【这本书没有涵盖关于 Ogre 3D 的所有细节只是一个提供了详实的介绍,作为读者的你,根 据此书,能够开始自己使用 Ogre 3D。读完本书后,你能够查找本书没有包含的所需信息和 复杂的技巧。】 What this book covers 【本书提要】 Chapter 1, Installing Ogre 3D, shows how to get and configure Ogre 3D. We also create our first scene and start learning the internals of Ogre 3D 【章节 1,安装 Ogre 3D,展示如何取得装配 Ogre 3D。我们还要创造我们的第一个场景并且
开始学习 Ogre 3D 的内含。】 Chapter 2, The Ogre Scene Graph, introduces us to the concept of a scene graph and how it is used for describing 3D scenes 【章节 2,Ogre 场景图,为我们介绍了场景图的概念以及如何运用它描述 3D 场景。】 Chapter 3, Camera, Light, and Shadow, adds lights and shadows to our scene and also experiments with different camera settings 【章节 3,相机,光与影,添加光与影到我们的场景中并尝试不同的相机设置。】 Chapter 4, Getting User Input and using the Frame Listener, adds interactivity to our application using user input 【章节 4,获取用户输入并使用 Frame 监听器,采用用户输入将其相互作用添加到我们的应 用程序中。】 Chapter 5, Animating Models with Ogre 3D, will enhance our scene using animations to add more interactivity and realism 【章节 5,Ogre 3D 动画模型,采用动画加入更多的互动和现实感来强化我们的场景。】 Chapter 6, Scene Managers, will introduce us to different concepts for organizing 3D scenes and what implication these choices will have 【章节 6,场景管理,将向我们介绍组织 3D 场景的不同理念和这些选择会有怎样的含义。】 Chapter 7, Materials with Ogre 3D, will show us how to add a new level of detail and flexibility to our application using materials and shaders. 【章节 7,Ogre 3D 材质,将向我们展示如何运用材料和渲染程序添加新层次的细节和灵活性 到我们的应用系统里。】 Chapter 8, The Compositor Framework, will show us how to add post processing effects to change the look of our complete scene with the knowledge about materials 【章节 8,合成器框架,将向我们展示如何添加后处理效果来改变我们完成了的场景的外 貌。】 Chapter 9, The Ogre 3D Startup Sequence, shows us how we can use Ogre 3D without the help of an ExampleApplication we had used previously 【章节 9,Ogre 3D 启动序列,向我们展示了没有我们之前使用的引例运用的帮助,如何运用 Ogre 3D。】 Chapter 10, Particle Systems and Extending Ogre 3D, gives an introducton to some more advanced techniques and perspectives that can be done with Ogre 3D 【章节 10,粒子系统和 Ogre3D 的延伸。给出了一些运用 Ogre3D 能达到的更加先进的技术 和前景。】 What you need for this book 【读本书所需基础】 You need a solid understanding of C++ and how to create applications using C++ for this book. Of course, you need a compiler to compile the example applications. This book uses Visual Studio as a reference, but any other compiler will also do. Your computer should have a graphic card with 3D capabilites. It would be best if the graphic card supports DirectX 9.0 because Ogre 3D is an open source software and we will download it in Chapter 1. So there is no need for you to have Ogre 3D already installed on your computer. 【为学习本书,你需要很好得掌握 C++语言以及如何运用 C++创造应用程序。当然,你需
要一个编辑器来编辑示例应用程序。本书使用 Visual Studio 作为参考,但其他编辑器也是可 以的。你的电脑应装有 3D 性能的显卡。如果你的显卡支持 DirectX 9.0 就更好了,因为 Ogre3D 是一个开源软件,我们要在章节 1 中下载它。因此,你的电脑不需要事先安装 Ogre 3D。】 Who this book is for 【读者】 If you ever wanted to develop 3D application with Ogre 3D, this example-driven book will enable you to do so. Understanding of C++ is needed to follow the examples in the book. This book is an example-driven introduction to Ogre 3D. Each example shows some new features and you learn step-by-step to create complex scenes with different effects using Ogre 3D. After several examples discussing one topic, there is a do-it-yourself part where you will be challenged to solve problems on your own. 【如果你曾想用 Ogre 3D 开发 3D 应用程序,这本引例驱动的书能够使你梦想成真。你需要 掌握 C++来学习本书中的例题。本书是一本引例驱动的 Ogre3D 简介。每个例题都会显示一 些新的特征,你将一步步地学习用 Ogre 3D 制造出有着不同效果的复杂场景。看完几个关于 一个主题的例题后,会有一个练习部分,在这个部分,你将要迎接自己解决问题的挑战。】 Conventions 【惯例】 In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning. 【为了把不同种类的信息区分开来,您将会在本书中发现一系列的文本样式。这里有这些样 式的一些列子,以及它们含义的解释。】 Code words in text are shown as follows: "Delete all the old code in createScene(), except for the plane-related code." 【文中的编码显示如下:“Delete all the old code in createScene(), except for the plane-related code."】 A block of code is set as follows: void MyFragmentShader2(float2 uv : TEXCOORD0, out float4 color : COLOR, uniform sampler2D texture) 【一个代码块设置如下:void MyFragmentShader2(float2 uv : TEXCOORD0, out float4 color : COLOR, uniform sampler2D texture)】 New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Press Ok and start the Applicaton. " 【新术语和重要词语用粗体显示。举例说明,你在屏幕上,菜单里或对话框里看到的字,在 文中是这样显示的:“点击 OK 启动一个应用程序。”】 关于译者
琳琳 程光曦微 前言部分 第一章 第二章—第九章 呢喃的歌声 第十章 Fss 翻译声明: 本人仅仅英语六级水平,因为喜欢翻译和喜欢 Ogre,翻译以下文字,如果哪里有错误或不足还望大虾们 见谅,如果您发现有什么错误,请把问题发送到 whistleofmysong@gmail.com 或者在我的博客 www.singmelody.com 留言,我将尽快的改正。这对他人是个帮助,对自己也是个鼓励~^_^ 相关法律 《中华人民共和国著作权法》 第二节 著作权归属 第十二条 改编、翻译、注释、整理已有作品而产生的作品,其著作权由改编 、翻译、注释、整理人享有,但行使著作权时,不得侵犯原作品的著作权。 第四节 权利的限制 第二十二条 在下列情况下使用作品,可以不经著作权人许可,不向其支付报酬,但应 当指明作者姓名、作品名称,并且不得侵犯著作权人依照本法享有的其他权利: (六)为学校课堂教学或者科学研究,翻译或者少量复制已经发表的作品,供 教学或者科研人员使用,但不得出版发行; 相关资源: Ogre 3D wiki:http://www.ogre3d.org/tikiwiki/ Ogre 3D 中文 wiki: http://ogre3d.cn 本书源代码地址: http://download.csdn.net/detail/chinarpgmaker/4031545 相关建议: 建议大家结合着 Ogre 官方的 wiki 一起看,虽然是英文,但是可以原滋原味的理解清除 Ogre 到底是怎么回事。还有一本非常好的 Ogre 的书 《OGRE 3D 程序设计》 , 这本书详细的讲 解了 Ogre 的原理部分。此书重点在于入门,应用和基础概念的讲解。重点的章节为第六章, 第七章和第九章 感想与感悟: "When I was a young man, I had liberty, but I did not see it. I had time, but I did not know it. And I had love, but I did not feel it. Many decades would pass before I understood the meaning of all three. And now, the twilight of my life, this understanding has passed into contentment. Love, liberty, and time: once so disposable, are the fuels that drive me forward. And love, most especially, mio caro. For you, our children, our brothers and sisters. And for the vast
and wonderful world that gave us life, and keeps us guessing. Endless affection, mio Sofia. Forever yours, Ezio Auditore." Installing Ogre 3D 【 第一章 安装 Ogre 3D 引擎 】 Downloading and installing a new library are the first steps of learning about and using it. 【 想要学习并且使用 Ogre,就要先下载并安装它. 】 In this chapter, we will learn about: 【 在这章,我们将会学习到: 】 * Download and install Ogre 3D * Have our development environment working with Ogre 3D * Create our first scene rendered by Ogre 3D So let's get on with it. 【 * 下载并安装 Ogre 3D 引擎 * 配置好 Ogre 3D 引擎的开发环境 * 用 Ogre 3D 引擎构建第一个场景 那我们就开搞了。 】 Downloading and installing Ogre 3D 【 下载并安装 Ogre 3D 引擎 】 The first step we need to take is to install and configure Ogre 3D. 【 我们要干的第一步就是安装并配置 Ogre 3D 引擎 】 Time for action – downloading and installing Ogre 3D 【 实践时刻——下载并安装 Ogre 3D 引擎 】 We are going to download the Ogre 3D SDK and install it so that we can work with it later. 【 为了后面的使用,现在我们就要下载安装 Ogre 3D SDK 了 】 1. Go to http://www.ogre3d.org/download/sdk. 【 1.打开 http://www.ogre3d.org/download/sdk. 的链接 】
2. Download the appropriate package. If you need help picking the right package, take a look at the next What just happened section. 【 2.下载合适的安装包。如果你对要下载哪个正确的安装包而需要帮助时,那就看看后面 的“刚刚发生了什么”这一部分 】 3. Copy the installer to a directory you would like your OgreSDK to be placed in. 【 3.把 SDK 的安装程序复制到你希望把 OgreSDK 放置的文件夹里 】 4. Double-click on the Installer; this will start a self extractor. 【 4.双击安装程序,这会启动一个自解压缩程序 】 5. You should now have a new folder in your directory with a name similar to OgreSDK_vc9_v1-7-1. 【 5.现在你应该得到一个名字类似于 OgreSDK_vc9_v1-7-1 的文件夹 】 6. Open this folder. It should look similar to the following screenshot: 【 6.打开该文件夹。文件夹的内容应该像下面的截图 】 What just happened? 【 刚刚发生了什么?】 We just downloaded the appropriate Ogre 3D SDK for our system. Ogre 3D is a cross-platform render engine, so there are a lot of different packages for these different platforms. After downloading we extracted the Ogre 3D SDK. 【 我们刚刚只是下载了一个适合我们操作系统的 Ogre 3D SDK。Ogre 3D 引擎是一个跨平 台的渲染引擎,所以对于不同的操作系统就有不同的开发包。下载完 Ogre 3D SDK 我们解 压了它。 】 Different versions of the Ogre 3D SDK
分享到:
收藏