官网
https://www.ogre3d.org/
主页
https://wiki.ogre3d.org/Home
Manual
https://ogrecave.github.io/ogre/api/latest/manual.html#SEC_Contents
API
https://www.ogre3d.org/docs/api/1.9/
https://ogrecave.github.io/ogre/api/latest/
SDK
http://www.ogre3d.org/download/sdk
学习
https://wiki.ogre3d.org/tiki-index.php?page=Tutorials
Python-Ogre
https://wiki.ogre3d.org/PyOgre
https://wiki.ogre3d.org/Python-Ogre
图形学
http://staff.ustc.edu.cn/~zhuang/acg/index.htm
示例代码
#include <Ogre.h>
int main()
{
// 创建 Root
Ogre::Root* root = new Ogre::Root();
// 加载插件
root->loadPlugin("RenderSystem_GL");
// 创建 RenderSystem
Ogre::RenderSystem* rs = root->getRenderSystemByName("OpenGL Rendering Subsystem");
root->setRenderSystem(rs);
// 初始化 Root
root->initialise(false);
// 创建窗口
Ogre::RenderWindow* window = root->createRenderWindow("Ogre3D Example", 800, 600, false);
// 创建场景管理器
Ogre::SceneManager* sceneMgr = root->createSceneManager(Ogre::ST_GENERIC);
// 创建相机
Ogre::Camera* camera = sceneMgr->createCamera("MainCamera");
camera->setPosition(Ogre::Vector3(0, 0, 500));
camera->lookAt(Ogre::Vector3(0, 0, 0));
// 创建视口
Ogre::Viewport* viewport = window->addViewport(camera);
viewport->setBackgroundColour(Ogre::ColourValue(0.5, 0.5, 0.5));
// 设置渲染队列
sceneMgr->setRenderQueueInvocationSequenceName("Basic");
// 创建实体
Ogre::Entity* entity = sceneMgr->createEntity("ExampleEntity", "ogrehead.mesh");
// 创建场景节点
Ogre::SceneNode* node = sceneMgr->getRootSceneNode()->createChildSceneNode();
node->attachObject(entity);
// 开始渲染循环
while (!window->isClosed())
{
// 渲染一帧
root->renderOneFrame();
}
// 清理
root->shutdown();
delete root;
return 0;
}