游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2380|回复: 3

mSceneMgr->setAmbientLight( ColourValue( 1, 1, 1 ) );

[复制链接]

22

主题

44

帖子

44

积分

注册会员

Rank: 2

积分
44
发表于 2008-3-17 12:28:00 | 显示全部楼层 |阅读模式
#include "ExampleApplication.h"

class TutorialApplication : public ExampleApplication
{
protected:
public:
    TutorialApplication()
    {
    }

    ~TutorialApplication()
    {
    }
protected:
    void createScene(void)
    {
         mSceneMgr->setAmbientLight( ColourValue( 1, 1, 1 ) );
    }
};

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"

INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
#else
int main(int argc, char **argv)
#endif
{
    // Create application object
    TutorialApplication app;

    try {
        app.go();
    } catch( Exception& e ) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
        fprintf(stderr, "An exception has occured: %s\n",
                e.getFullDescription().c_str());
#endif
    }

    return 0;
}




mSceneMgr->setAmbientLight( ColourValue( 1, 1, 1 ) ); 为什么放在 createScene 中,运行后,没有颜色?

32

主题

1259

帖子

1351

积分

金牌会员

Rank: 6Rank: 6

积分
1351
发表于 2008-3-17 21:33:00 | 显示全部楼层

Re:mSceneMgr->setAmbientLight( ColourValue( 1, 1, 1 ) );

because 你啥东西也没有画

9

主题

55

帖子

59

积分

注册会员

Rank: 2

积分
59
发表于 2008-3-18 09:28:00 | 显示全部楼层

Re:mSceneMgr->setAmbientLight( ColourValue( 1, 1, 1 ) );

你只设置了环境光为白色...场景内没有东西.

22

主题

44

帖子

44

积分

注册会员

Rank: 2

积分
44
 楼主| 发表于 2008-3-18 15:05:00 | 显示全部楼层

Re:mSceneMgr->setAmbientLight( ColourValue( 1, 1, 1 ) );

恩,是的。后来在场景中添加了一个地图,就OK了
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-12-20 12:47

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表