ogre3d 资料

官网

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/Python-Ogre

图形学

http://staff.ustc.edu.cn/\~zhuang/acg/index.htm

示例代码

c++ 复制代码
#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;
}
 
相关推荐
一个笔记本1 天前
godot log | 修改main scene
游戏引擎·godot
nnsix1 天前
Unity PicoVR开发 实时预览Unity场景 在Pico设备中(串流)
unity·游戏引擎
一只一只2 天前
Unity之UGUI Button按钮组件详细使用教程
unity·游戏引擎·ugui·button·ugui button
神米米2 天前
Maya快速安装UE4 布料权重绘制插件PhysX导出apx
游戏引擎·ue4·maya
WarPigs2 天前
Unity阴影
unity·游戏引擎
一只一只2 天前
Unity之Invoke
unity·游戏引擎·invoke
技术小甜甜2 天前
【Godot】【入门】信号系统从 0 到 1(UI/玩法彻底解耦的通用写法)
ui·游戏引擎·godot
技术小甜甜2 天前
【Godot】【入门】节点生命周期怎么用(避免帧循环乱写导致卡顿的范式)
游戏引擎·godot
tealcwu2 天前
【Unity踩坑】Simulate Touch Input From Mouse or Pen 导致检测不到鼠标点击和滚轮
unity·计算机外设·游戏引擎
ThreePointsHeat2 天前
Unity WebGL打包后启动方法,部署本地服务器
unity·游戏引擎·webgl