Professional Documents
Culture Documents
BasicTutorial1SourceCurrent-cdeKey RZNLQG2AM3KMCZZXNVO5HTWO2M2L2OCK
BasicTutorial1SourceCurrent-cdeKey RZNLQG2AM3KMCZZXNVO5HTWO2M2L2OCK
Ogre Forums ogre3d.org
Ogre Wiki
Login
Support and community documentation for Ogre3D
Home Tutorials Cookbook Libraries Tools Development Community
Ogre Wiki Help Toolbox
SEARCH BY TAGS
Welcome to the new Ogre Wiki! Search Wiki by Freetags
If you haven't done so already, be sure to visit the Wiki Portal to read about
how the wiki works. Especially the Ogre Wiki Overview page. LAST CHANGES
BasicTutorial1SourceCurrent 1. Ogre 2.1 FAQ
2. Ogre3D Steam Games
Backlinks... Sales Charts
3. Manual Resource Loading
4. Intermediate Tutorial 7
Tutorials » Basic Tutorials » Basic Tutorial 1 »
5. Intermediate Tutorial 6
BasicTutorial1SourceCurrent 6. Particle Universe plugin
7. HLMS Editor (Ogre 2.0 )
TutorialApplication.h
8. HLMS Editor
9. OGRE DCC Tools
#ifndef __TutorialApplication_h_
10. HLMSEditor.png
#define __TutorialApplication_h_ ...more
#include "BaseApplication.h" SEARCH BOX
class TutorialApplication : public BaseApplication
Advanced search:
{ GO
public:
TutorialApplication(); ONLINE USERS
virtual ~TutorialApplication();
24 online users
protected:
virtual void createScene();
virtual void createCamera();
virtual void createViewports();
};
#endif // #ifndef __TutorialApplication_h_
TutorialApplication.cpp
#include "TutorialApplication.h"
TutorialApplication::TutorialApplication(void)
{
}
TutorialApplication::~TutorialApplication(void)
{
http://www.ogre3d.org/tikiwiki/tikiindex.php?page=BasicTutorial1SourceCurrent 1/4
16/07/2016 BasicTutorial1SourceCurrent
}
void TutorialApplication::createScene(void)
{
mSceneMgr>setAmbientLight(Ogre::ColourValue(0.5, 0.5,
0.5));
mCamera>setPosition(0, 47, 222);
Ogre::Light* light = mSceneMgr
>createLight("MainLight");
light>setPosition(20.0, 80.0, 50.0);
Ogre::Entity* ogreEntity = mSceneMgr
>createEntity("ogrehead.mesh");
Ogre::SceneNode* ogreNode = mSceneMgr
>getRootSceneNode()>createChildSceneNode();
ogreNode>attachObject(ogreEntity);
Ogre::Entity* ogreEntity2 = mSceneMgr
>createEntity("ogrehead.mesh");
Ogre::SceneNode* ogreNode2 = mSceneMgr
>getRootSceneNode()>createChildSceneNode(
Ogre::Vector3(84, 48, 0));
ogreNode2>attachObject(ogreEntity2);
Ogre::Entity* ogreEntity3 = mSceneMgr
>createEntity("ogrehead.mesh");
Ogre::SceneNode* ogreNode3 = mSceneMgr
>getRootSceneNode()>createChildSceneNode();
ogreNode3>setPosition(Ogre::Vector3(0, 104, 0));
ogreNode3>setScale(2, 1.2, 1);
ogreNode3>attachObject(ogreEntity3);
Ogre::Entity* ogreEntity4 = mSceneMgr
>createEntity("ogrehead.mesh");
Ogre::SceneNode* ogreNode4 = mSceneMgr
>getRootSceneNode()>createChildSceneNode();
ogreNode4>setPosition(84, 48, 0);
ogreNode4>roll(Ogre::Degree(90));
ogreNode4>attachObject(ogreEntity4);
}
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
http://www.ogre3d.org/tikiwiki/tikiindex.php?page=BasicTutorial1SourceCurrent 2/4
16/07/2016 BasicTutorial1SourceCurrent
#include "windows.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
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(Ogre::Exception& e) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox(NULL,
e.getFullDescription().c_str(), "An exception has
occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
std::cerr << "An exception has occurred: " <<
e.getFullDescription().c_str() <<
std::endl;
#endif
}
return 0;
}
#ifdef __cplusplus
}
#endif
Contributors to this page: kabbotta .
Page last modified on Wednesday 01 of April, 2015 06:37:40 UTC by kabbotta .
The content on this page is licensed under the terms of the Creative Commons
AttributionShareAlike License.
As an exception, any source code contributed within the content is released into
the Public Domain.
SOURCE HISTORY
Click this link to toggle the Report Page Issue Form
http://www.ogre3d.org/tikiwiki/tikiindex.php?page=BasicTutorial1SourceCurrent 3/4
16/07/2016 BasicTutorial1SourceCurrent
Powered by Tiki Wiki CMS Groupware
http://www.ogre3d.org/tikiwiki/tikiindex.php?page=BasicTutorial1SourceCurrent 4/4