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 小时前
动作游戏网游:帧同步下的动画同步
unity·游戏引擎
WMX10122 小时前
Unity添加近身菜单-MRTK
unity·游戏引擎
星依网络18 小时前
使用LabelImg工具标注数据(游戏辅助脚本开发)
python·游戏引擎·图形渲染·骨骼绑定
AT~19 小时前
unity 使用Socket和protobuf实现网络连接
unity·游戏引擎
feiduoge1 天前
教程 36 - 方向光照
windows·游戏引擎·图形渲染
呼呼突突1 天前
Unity使用TouchSocket的RPC
unity·rpc·游戏引擎
qq_428639612 天前
虚幻基础:安装插件
游戏引擎·虚幻
AA陈超2 天前
虚幻引擎5 GAS开发俯视角RPG游戏 P07-18.生成火球术
c++·游戏·ue5·游戏引擎·虚幻
Doc.S2 天前
多无人机任务自定义(基于ZJU-FAST-Lab / EGO-Planner-v2)
游戏引擎·无人机·cocos2d
nnsix2 天前
Unity OpenXR开发HTC Vive Cosmos
unity·游戏引擎