- 积分
- 23
- 帖子
- 7
- 主题
- 6
- 精华
- 0
- 最后登录
- 2009-9-16
- 在线时间
- 2 小时
- 私信
|
发表时间 : 2009-8-17 20:02:22
|
浏览 : 2146 评论 : 2
学习OGRE不久 遇到了个奇怪的问题
大家看看下面的代码 是我用DEMO-EnvMapping该的 我把EnvMapping.h文件该成了一下内容
#include "ExampleApplication.h"
SceneNode *zy;
float rot_x=40;
class MyFrameListener : public ExampleFrameListener
{
public:
bool frameRenderingQueued(const FrameEvent& evt)
{
if( ExampleFrameListener::frameRenderingQueued( evt ) == false )
return false;
if( mKeyboard->isKeyDown( OIS::KC_1 ) ) {
rot_x += (5.0f*evt.timeSinceLastFrame);
}
return true;
}
};
class EnvMapApplication : public ExampleApplication
{
public:
EnvMapApplication() {}
protected:
// Just override the mandatory create scene method
void createScene(void)
{
// Set ambient light
mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
// Create a point light
Light* l = mSceneMgr->createLight("MainLight");
// Accept default settings: point light, white diffuse, just set position
// NB I could attach the light to a SceneNode if I wanted it to move automatically with
// other objects, but I don't
l->setPosition(20,80,50);
Entity *ent = mSceneMgr->createEntity("head", "ogrehead.mesh");
// Set material loaded from Example.material
ent->setMaterialName("Examples/EnvMappedRustySteel");
// Add entity to the root scene node
zy=mSceneMgr->getRootSceneNode()->createChildSceneNode();
zy->attachObject(ent);
zy->yaw(Degree(rot_x));
}
};
按我的理解 这个时候按下 “1”键 那个兽头模型应该会旋转才对
为什么运行后没有这样的效果 请大家帮我看看 谢谢 |
|