最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 正文

OGRE安装方法

来源:动视网 责编:小OO 时间:2025-10-01 09:54:33
文档

OGRE安装方法

下载安装Ogre学习使用Ogre的第一步,下载并且安装一个新的程序库。在这个章节中,我们将要进行如下步骤:▪‹下载并安装Ogre3D。▪配置Ogre3D的工作环境。▪使用Ogre3D创建第一个渲染场景。好吧,让我们上路吧。下载并且安装Ogre3D第一步我们需要安装并配置Ogre3D。动手时间–下载并安装Ogre3D我们需要去下载Ogre3DSDK并安装,这样我们才可以在之后的工作中使用。1去到网站http://www.ogre3d.org/download/sdk.2下载所需要的程序包,如果你
推荐度:
导读下载安装Ogre学习使用Ogre的第一步,下载并且安装一个新的程序库。在这个章节中,我们将要进行如下步骤:▪‹下载并安装Ogre3D。▪配置Ogre3D的工作环境。▪使用Ogre3D创建第一个渲染场景。好吧,让我们上路吧。下载并且安装Ogre3D第一步我们需要安装并配置Ogre3D。动手时间–下载并安装Ogre3D我们需要去下载Ogre3DSDK并安装,这样我们才可以在之后的工作中使用。1去到网站http://www.ogre3d.org/download/sdk.2下载所需要的程序包,如果你
下载安装Ogre

学习使用Ogre的第一步,下载并且安装一个新的程序库。

在这个章节中,我们将要进行如下步骤:

▪‹下载并安装Ogre3D。

▪配置Ogre 3D的工作环境。

▪使用Ogre 3D创建第一个渲染场景。

好吧,让我们上路吧。

下载并且安装Ogre 3D

第一步我们需要安装并配置Ogre 3D。

动手时间 – 下载并安装Ogre 3D

我们需要去下载Ogre 3D SDK并安装,这样我们才可以在之后的工作中使用。

1去到网站 http://www.ogre3d.org/download/sdk.

2下载所需要的程序包,如果你需要帮忙挑选一个合适的安装包,可以看看“刚刚发生了什么”章节里面所说的。

3复制安装程序到你想让OgreSDK放置的目录。

4在安装程序上双击,接下来会启动一个自解压程序。

5现在在这个目录下,你应该有一个名字类似OgreSDK_vc9_v1-7-1这样的新文件夹。

6打开这个文件夹。它开起来类似下图:

刚刚发生了什么?

我们刚才为我们的系统下载了一套合适的Ogre 3D SDK。Ogre 3D是一个跨平台渲染引擎,不同的平台有不同的包。下载之后我们解压了Ogre 3D SDK。

Ogre 3D SDK的不同版本

Ogre支持很多不同的平台,正因为如此,提供有一些不同的包供我们下载。Ogre 3D为Windowss上不同的构建方式提供了若干个包,为MacOSX和Ubuntu各提供了一个包。另外有两个包是提供给MinGW和iPhone的。如果你喜欢,你可以下载源代码并亲自编译Ogre 3D。这个章节将会把重点放在Windows预构建SDK上,以及如何配置你的开发环境。如果你要用其它操作系统,你可以看看Ogre 3D的维基,地址是http://www.ogre3d.org/wiki 。维基上涵盖了详细的不同平台开发环境的搭建方法。本书的其余内容都是平台无关性的,所以如果你要用其它开发系统,敬请随意。除了配置方式和你在构建环境方面的习惯之外,没什么能影响到本书内容的。

探索SDK

在我们开始构建SDK中的样例之前,让我们先用眼睛扫一眼这个SDK吧。在Windows平台下,我们将看到SDK有着这样一个结构。而在Linux或MacOS上,这个结构或许会有所不同。首先我们打开bin文件夹。我们会看到两个文件夹,名字分别为debug和release。lib目录也是相同的情况。原因是Ogre 3D SDK的库(包括动态链接/共享库)提供了debug和release两种构建。这样的话,我们在开发时使用了debug构建,就能调试我们的项目。当项目完成时,我们能够把项目同release构建进行连接,以获得Ogre 3D全部的性能。

不管打开debug还是release文件夹,我们都能看到很多dll文件和一些cfg文件,以及两个可执行文件(exe)。这两个可执行文件用于内容的创建和把内容更新给新版Ogre,所以跟我们没什么关系。

The OgreMain.dll is the most important DLL. It is the compiled Ogre 3D source code we will load later. All DLLs with Plugin_ at the start of their name are Ogre 3D plugins we can use with Ogre 3D. Ogre 3D plugins are dynamic libraries, which add new functionality to Ogre 3D using the interfaces Ogre 3D offers. This can be practically anything, but often it is used to add features like better particle systems or new scene managers. What these things are will be discussed later. The Ogre 3D community has created many more plugins, most of which can be found in the wiki. The SDK simply includes the most generally used plugins. Later in this book, we will learn how to use some of them. The DLLs with RenderSystem_ at the start of their name are, surely not surprisingly, wrappers for different render systems that Ogre 3D supports. In this case, these are Direct3D9 and OpenGL. Additional to these two systems, Ogre 3D also has a Direct3D10, Direct3D11, and OpenGL ES(OpenGL for Embedded System) render system. OgreMain.dll这个文件是最主要的DLL文件, 这个文件是编译好的Ogre3D源文件, 我们将在后边加载使用它。 所有的以Plugin_开头的文件是Ogre的插件。 插件也是动态链接库, 他们使用ogre提供的接口 提供一些ogre本身没有的功能。 你可以通过插件的形式为ogre提供任何功能, 但是一般我们使用插件 提供更好的分块系统, 或是新的场景管理器。 我们将在后边讲解什么是分块系统和场景管理器。 ogre社区 提供了很多插件, 这些插件可以在wiki里找到。 SDK中只包含最常用的一些插件。 书的后边, 我们会学习 使用一些主要的插件。 RenderSystem_开头的dll文件是ogre支持的不同渲染系统的封装。 这里, 我们可以 看到有D3D9和OpenGL。 除了这两种, ogre还支持D3D10和D3D11以及 OpenGL ES。

Besides the executables and the DLLs, we have the cfg files. cfg files are config files that Ogre 3D can load at startup. Plugins.cfg simply lists all plugins Ogre 3D should load at startup. These are typically the Direct3D and OpenGL render systems and some additional SceneManagers. quakemap.cfg is a config file needed when loading a level in the Quake3 map format. We don't need this file, but a sample does. 除了可执行文件和DLL, 我们还可以看到一些cfg文件。 cfg文件是供ogre在启动的时候加载的 配置文件。Plugins.cfg是ogre在启动时应该加载的插件的列表, 一般会包含D3D或OpenGL渲染系统, 场景管理器。 quakemap.cfg是用来加载Quake3地图格式中的关卡的, 在一个例子里需要使用到这个文件。

resources.cfg contains a list of all resources, like a 3D mesh, a texture, or an animation, which Ogre 3D should load during startup. Ogre 3D can load resources from the file system or from a ZIP file. When we look at resources.cfg, we will see the following lines: resources.cfg包含了ogre应该在启动的时候加载的资源的列表, 比如 3D 网格, 贴图, 动画。ogre可以 从文件系统或是ZIP文件中加载资源文件。 打开resources.cfg我们看以看到这样的语句:

Zip=../../media/packs/SdkTrays.zip

FileSystem=../../media/thumbnails

Zip= means that the resource is in a ZIP file and FileSystem= means that we want to load the contents of a folder. resources.cfg makes it easy to load new resources or change the path to resources, so it is often used to load resources, especially by the Ogre samples. Speaking of samples, the last cfg file in the folder is samples.cfg. We don't need to use this cfg file. Again, it's a simple list with all the Ogre samples to load for the SampleBrowser. But we don't have a SampleBrowser yet, so let's build one. ZIP= 意思是要加载的资源文件在某个ZIP文件中, FileSystem= 意思是我们要从某个文件夹中 加载资源文件。 通过resources.cfg, 我们可以很轻松的加载新的资源文件, 或是指定新的含有 资源文件的文件夹, ogre的示例中常使用这个文件加载资源。 现在我们看一下最后一个文 件sample.cfg, 我们不需要使用这个文件。 这个文件其实是一个示例的列表, 包含了所有的 可以通过SampleBrowser加载的示例。 但是我们现在还没有SampleBrowser这个程序, 所以, 我们需要把源代码进行编译。

The Ogre 3D samples OGRE的例子

Ogre 3D comes with a lot of samples, which show all the kinds of different render effects and techniques Ogre 3D can do. Before we start working on our application, we will take a look at the samples to get a first impression of Ogre's capabilities. ORGE 引擎自带了很多的 例子, 这些例子演示了所有OGRE能做的渲染特效和技术功能。 在开始构建我们自己的应用程序之前, 我们最好还是先看一下 这些例子, 对ORGE的功能有个初步的认识。

Time for action – building the Ogre 3D samples 编译OGRE的例子

To get a first impression of what Ogre 3D can do, we will build the samples and take a look at them. 为了对OGRE有个初步的认识, 我们首先要对例子进行编译, 然后我们就可以运行他们了。

7Go to the Ogre3D folder. 进入 OGRE 的文件夹

8Open the Ogre3d.sln solution file. 打开 .sln 文件

9Right-click on the solution and select Build Solution. 在解决方案上点击右键并选择构建。

10Visual Studio should now start building the samples. This might take some time, soget yourself a cup of tea until the compile process is finished. VS现在应该开始编译整个示例项目。 这可能需要一点时间, 所以休息一下, 不要走开~

11If everything went well, go into the Ogre3D/bin folder. 如果顺利的话编译应该可以正常完成, 然后进入 bin文件夹。

12Execute the SampleBrowser.exe.

13You should see the following on your screen:

8. Try the different samples to see all the nice features Ogre 3D offers.

What just happened?

We built the Ogre 3D samples using our own Ogre 3D SDK. After this, we are sure to have a working copy of Ogre 3D.

文档

OGRE安装方法

下载安装Ogre学习使用Ogre的第一步,下载并且安装一个新的程序库。在这个章节中,我们将要进行如下步骤:▪‹下载并安装Ogre3D。▪配置Ogre3D的工作环境。▪使用Ogre3D创建第一个渲染场景。好吧,让我们上路吧。下载并且安装Ogre3D第一步我们需要安装并配置Ogre3D。动手时间–下载并安装Ogre3D我们需要去下载Ogre3DSDK并安装,这样我们才可以在之后的工作中使用。1去到网站http://www.ogre3d.org/download/sdk.2下载所需要的程序包,如果你
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top