BLOGGER TEMPLATES AND TWITTER BACKGROUNDS »

Rabu, 17 Maret 2010

LisTin9 o9Re niH cuY....

#include "ExampleApplication.h"
class BelajarOgre : public ExampleApplication {
public:
BelajarOgre(){
}
~BelajarOgre(){
}
protected:
void createScene(void){
// menset pencahayaan
mSceneMgr->setAmbientLight( ColourValue( 1, 1, 1 ) );
mSceneMgr->setSkyDome(true, "Examples/CloudySky", 5, 8, 500);
//mSceneMgr utk manage semua semua yg tampil pd screen
mSceneMgr->setAmbientLight(ColourValue(1,1,1));
//Entity ad objek yg bs dirender discene
Entity *ent1 = mSceneMgr->createEntity("Robot","robot.mesh");
Entity *ent2 = mSceneMgr->createEntity("Robot2","robot.mesh");

SceneNode *node1 = mSceneMgr->getRootSceneNode()->createChildSceneNode("RobotNode");
SceneNode *node2 = mSceneMgr->getRootSceneNode()->createChildSceneNode("RobotNode2", Vector3(50,-100,0));
//attach entity ke scenenode ut beri lokasi render robot
node1->attachObject(ent1);
node2->attachObject(ent2);
}
};


#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
{
//bikin objek aplikasi
BelajarOgre app;
try {
app.go();
} catch (Exception e) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox(NULL,e.what(),"Terjadi Error!",MB_OK | MB_ICONERROR |MB_TASKMODAL);
#else
fprintf(stderr,"Terjadi Error = %s\n",e.what());
#endif
}
return 0;
}

Tidak ada komentar:

Posting Komentar

Dynamic Blinkie Text Generator at TextSpace.net