OGRE demo分析
来源:互联网 发布:淘宝商家联系方式 编辑:程序博客网 时间:2024/05/21 09:58
开发环境:
winxp,mingw,codeblock,OgreSDK_mingw_v1-7-2,字符编码为utf8
ogre官方的例子非常绚丽,非常实用,但不适合初学者,为了让广大和我一样的菜鸟少走弯路和以后方便重用其中的代码,这学期开始分析ogre官方demo,将复杂的demo细分为重用性更高的例子,并提供能独立编译运行的工程文件,例子程序坚决摒弃继承和设计模式,直接读源程序就能摸清例子的工作流程和算法细节,其中部分代码加入中文注释
其他的ogre学习资源推荐:so3Dtools,《OGRE 3D 1.7 Beginner's Guide》,谷歌一下就行
本人QQ:343763274,欢迎交流,欢迎合作,欢迎拍砖,如有错误,纯属巧合
demo1-草地的制作:
http://www.pudn.com/downloads328/sourcecode/windows/system/detail1443176.html
demo2-灯光轨迹动画:
注意:
mSceneMgr->setAmbientLight(ColourValue::Black);//关闭环境光,才能显示模型材质的效果
http://www.pudn.com/downloads328/sourcecode/game/detail1443147.html
demo3:
简单第一人称射击,Ogre::Ray的使用
注意:
传给getCameraToViewportRay()的必须是0~1的两个浮点型数值,由于ScreenX/screenWidth为int/int,
结果也为int,获得的射线将不准确,int/float为float,所以必须强制类型转换
Ogre::Ray ray=mCamera->getCameraToViewportRay(mX/(float)arg.state.width,mY/(float)arg.state.height);
显示系统光标
pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND")));
pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE")));
http://www.pudn.com/downloads328/sourcecode/windows/network/detail1445768.html
demo4:简单的aabb盒碰撞:
http://www.pudn.com/downloads332/sourcecode/game/detail1460588.html
demo5:ManualObject的绘制
可用于导入自定义格式的模型文件,bullet中的debugdraw
http://www.pudn.com/downloads338/sourcecode/game/detail1479266.html
demo6
比较复杂的例子,ogrebullet的一次封装。可以通过鼠标单击选择物体,然后移除物体,需要先编译bullet,注意:
库的链接顺序
phyObject->setSleepingThresholds(0,0);//禁止物体休眠,不然移除物体的时候不能唤醒新的模拟,需要外力驱动
- OGRE demo分析
- 【笔记】六、OGRE与CEGUI中Demo分析
- My OGRE demo
- OGRE DEMO 效果截图
- First Demo of OGRE
- Second Demo of OGRE
- Third Demo of OGRE
- Fourth Demo of OGRE
- Seventh Demo of OGRE
- Eighth Demo of OGRE
- Eleventh Demo of OGRE
- Twelfth Demo of OGRE
- Thirteenth Demo of OGRE
- Fifteenth Demo of OGRE
- Ogre海洋Demo注释
- 运行Ogre Demo出错
- Ogre 简易角色Demo
- Ogre -- Demo框架
- sql统计查询
- 情伤
- MIME协议发送邮件
- 傻人?
- JSP自定义EL函数
- OGRE demo分析
- matlab错误:Subscript indices must either be real positive integers or logicals.
- 伤情
- Ghost使用图解
- jquery ajax loading效果
- 客户端和服务端通讯的N种方式(一)
- 搞活动送的书《社会学》到了
- sizeof class or struct
- linux下printf输出字符串的颜色