剑痴乎

  • 首页
  • 文章分类
    • 音视频
    • WebRTC
    • 编程之美
    • Linux
    • Windows
    • 生活点滴
    • 校园生活
  • 参考
    • API参考
    • 实用工具
    • 测试音视频
    • 文档
  • 留言板
  • 关于
剑痴乎
代码为剑,如痴如醉
  1. 首页
  2. 编程之美
  3. 正文

Ogre学习笔记(1)

2014年3月3日 1628点热度 0人点赞 0条评论

由于毕设做的是基于Ogre的虚拟漫游系统,所以最近在很努力地学习Ogre知识。

刚才使用 Ogre AppWizard创建Ogre向导后,在vs2010下可以编译运行,但是在项目debug文件下运行时提示缺少.dll文件,去Ogre wiki上查了下,是这样说的:
Missing a Configuration File or DLLs
If you try to launch your freshly built application but the program complains of missing DLLs or configuration files (*.cfg), then you probably did not copy them over from the OgreSDK folder. In Visual Studios, when you build your application in release mode, it puts the release executable in the [ProjectFolder]\bin\release folder, and the debug executable in the [ProjectFolder]\bin\debug folder. You must copy all the ".dll" and ".cfg" files over from the OgreSDK into the appropriate folders. That is, copy the files from [OgreSDK]\bin\release to [ProjectFolder]\bin\release and [OgreSDK]\bin\debug to [ProjectFolder]\bin\debug. You will also need to edit the resources.cfg file to point at the correct paths. See the next section for more information on this.
也就是需要把[OgreSDK]\bin\debug下的全部文件都要拷贝到项目文件夹的debug下面,我按这说了,拷了过去,点击.exe文件,可是却提示:Unable to read zip file

搜狗截图20140303202503

再去查了下wiki,这样说的:
Make sure you have a plugins.cfg and a resources.cfg in the same directory as the executable. Plugins.cfg tells OGRE which rendering libraries are available (Direct3D9, OpenGL, etc). Resources.cfg is used by the ExampleApplication and specifies paths to textures, meshes and scripts. Both are text files, so edit them and make sure the paths are correct. Otherwise your OGRE setup dialog box may not have any rendering libraries in it, or you may receive an error on your screen or in Ogre.log that looks something like this:
Description: ../../Media/packs/OgreCore.zip - error whilst opening archive: Unable to read zip file

也就是需要把Resources.cfg中的路径配置改了,我把media文件夹都拷贝过来,media文件夹位置:D:\vs 2010\Projects\media,项目debug位置:D:\vs 2010\Projects\OgreApp4\OgreApp4\bin\Debug,设置好media文件夹相对于可执行文件的相对路径,
把Resources.cfg中media路径都改了,如下所示:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Resources required by the sample browser and most samples.
[Essential]
Zip=../../../../media/packs/SdkTrays.zip
Zip=../../../../media/packs/profiler.zip
FileSystem=../../../../media/thumbnails
 
# Common sample resources needed by many of the samples.
# Rarely used resources should be separately loaded by the
# samples which require them.
[Popular]
FileSystem=../../../../media/fonts
FileSystem=../../../../media/materials/programs
FileSystem=../../../../media/materials/scripts
FileSystem=../../../../media/materials/textures
FileSystem=../../../../media/materials/textures/nvidia
FileSystem=../../../../media/models
FileSystem=../../../../media/particle
FileSystem=../../../../media/DeferredShadingMedia
FileSystem=../../../../media/PCZAppMedia
FileSystem=../../../../media/RTShaderLib
FileSystem=../../../../media/RTShaderLib/materials
FileSystem=../../../../media/materials/scripts/SSAO
FileSystem=../../../../media/materials/textures/SSAO
Zip=../../../../media/packs/cubemap.zip
Zip=../../../../media/packs/cubemapsJS.zip
Zip=../../../../media/packs/dragon.zip
Zip=../../../../media/packs/fresneldemo.zip
Zip=../../../../media/packs/ogretestmap.zip
Zip=../../../../media/packs/ogredance.zip
Zip=../../../../media/packs/Sinbad.zip
Zip=../../../../media/packs/skybox.zip
 
[General]
FileSystem=../../../../media
 
# Materials for visual tests
[Tests]
FileSystem=../../../../media/../../../../Tests/Media

再次运行,可以正常运行了,错误也都没了,好吧,第一个简单的Ogre示例就这样跑起来了,这个脑袋看过去有点呆啊。

screenshot03032014_205250606

本作品采用 知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议 进行许可
标签: OGRE
最后更新:2018年12月23日

Jeff

管理员——代码为剑,如痴如醉

打赏 点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理。

相关文章
  • Ogre中阴影设置问题
  • Ogre中的场景文件
  • Ogre中加入声音
  • Ogre中的粒子系统(Particle System)
  • Ogre中简单的AABB碰撞检测

COPYRIGHT © 2025 jianchihu.net. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang