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;
}
 
相关推荐
zyh______3 小时前
unity值属性修改步骤
unity·游戏引擎
风酥糖5 小时前
Godot游戏练习01-第11节-显示优化,游戏背景,Shader
游戏·游戏引擎·godot
风酥糖9 小时前
Godot游戏练习01-第13节-粒子系统,武器攻击特效
游戏·游戏引擎·godot
张老师带你学12 小时前
unity船资源,快艇,帆船,游轮
科技·游戏·unity·游戏引擎·模型
C蔡博士13 小时前
Unity游戏物体渲染顺序
unity·游戏引擎·游戏开发
瑞瑞小安15 小时前
Unity功能篇:PCVR开发(设备:HTC Vive Pro)更新中。。。
unity·游戏引擎
风酥糖1 天前
Godot游戏练习01-第10节-组件化,玩家受伤,YSort,和一点思考
游戏·游戏引擎·godot
风酥糖2 天前
Godot游戏练习01-第12节-添加武器动画,同步动画显示
游戏·游戏引擎·godot
斯幽柏雷科技2 天前
[Unity]Inspector各种写法(持续更新中)
java·unity·游戏引擎