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;
}
 
相关推荐
L X..12 小时前
Unity 光照贴图异常修复笔记
unity·c#·游戏引擎
小L~~~1 天前
2025吉比特-游戏引擎开发-一面复盘
数据结构·算法·游戏引擎
云卓SKYDROID1 天前
无人机中继器模式技术对比
人工智能·游戏引擎·php·无人机·cocos2d·高科技·云卓科技
future_studio2 天前
聊聊 Unity(小白专享、熟悉基础编程 ... ...)
unity·游戏引擎
Brianna Home4 天前
Godot4.3开发2D游戏全记录
游戏·游戏引擎·godot·游戏程序·动画
王维志4 天前
使用Asp.Net WebApi(.net 8)托管Unity WebGL
unity·游戏引擎·webgl
开发游戏的老王4 天前
虚幻引擎入门教程:虚幻引擎的安装
游戏引擎·虚幻
muyouking114 天前
Unreal Engine 中的旋转表示:FQuat 与 FRotator 全面解析
游戏引擎·虚幻
霜绛5 天前
Unity:Json笔记——Json文件格式、JsonUtlity序列化和反序列化
学习·unity·json·游戏引擎
开发游戏的老王5 天前
虚幻引擎虚拟制片入门教程 之 创建项目及启用插件
游戏引擎·虚幻