Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

Mata Praktikum GRAFKOM2 Pertemuan-1

Presentasi serupa


Presentasi berjudul: "Mata Praktikum GRAFKOM2 Pertemuan-1"— Transcript presentasi:

1 Mata Praktikum GRAFKOM2 Pertemuan-1
PJ : Nuraini Purwandari Copyright©2010. This presentasion is dedicated to Laboratory of Information of Universitas Gunadarma

2 Sekilas Tentang Ogre OGRE (Object-oriented Graphics Rendering Engine) adalah open source rendering engine grafik yang ditulis dan dimaintain oleh tim inti kecil, Telah berkembang luas menjadi komunitas Tutorial

3 Cara Instalasi Ogre Berikut ini adalah file-file yg dibutuhkan untuk membuat aplikasi 3D dengan library OGRE3D (Object Oriented Graphics Rendering Engine) antara lain : Eclipse-CPP ganymede sebagai IDE C++ MinGW toolbox sebagai GCC opensource compiler MYSYS sebagai GNU Terminal environment OGRE3D SDK sebagai rendering engine di OGRE SDK for Code::Blocks + MinGW C++ Toolbox , perlu diperhatikan bahwa kita menggunakan MinGW sebagai c++ compilernya

4 Cara Instalasi Ogre Lakukan penginstalan Untuk masing-masing file tersebut Pertama, menginstal MinGW Toolbox Kedua, menginstal MYSYS Ketiga, lakukan setting environment variabel Keempat, menginstal OgreSDK

5 Cara Instalasi Ogre Kelima, membuka Eclipes Lalu Create New Project

6 Cara Instalasi Ogre DEBUG RELEASE Preprocessor Defined Symbols (-D): WIN32 _WINDOWS _DEBUG NDEBUG Directories Include Paths (-l): "${OGRE_HOME}\include" "${OGRE_HOME}\samples\include" Beserta kutip “ Miscellaneous Bag. Other flags : -c -fmessage-length=0 -mthreads -fexceptions -fident Setelah itu, pada bagian project explorer lalu tekan alt+enter maka Properties akan terbuka. Arahkan kebagian C/C++ Build  Settings, Klik Manage Configurations. Masuk ke bagian GCC C++ Compiler pada Tool Settings, selanjutnya ikutilah petunjuk table berikut ini untuk bagian-bagian properties pada pilihan Debug dan Release.

7 Masukkan Source Code : #include "ExampleApplication.h"
class BelajarOgre : public ExampleApplication { public: BelajarOgre(){ } ~BelajarOgre(){ protected: void createScene(void){ //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); };

8 #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) { MessageBox(NULL,e.what(),"Terjadi Error!",MB_OK | MB_ICONERROR |MB_TASKMODAL); fprintf(stderr,"Terjadi Error = %s\n",e.what()); } return 0;

9 Cara Instalasi Ogre Kemudian Build project tersebut, dan masuk kedalam direktori OgreSDK\bin\Debug lalu buka file resource.cfg Maka akan muncul seperti ini : Zip=../../../Media/packs/OgreCore.zip # Resource locations to be added to the default path [General] FileSystem=../../../Media FileSystem=../../../Media/fonts FileSystem=../../../Media/materials/programs FileSystem=../../../Media/materials/scripts FileSystem=../../../Media/materials/textures FileSystem=../../../Media/models FileSystem=../../../Media/overlays FileSystem=../../../Media/particle

10 Cara Instalasi Ogre Lalu ganti bagian ../../../ dengan fullpath lokasi OgreSDK misal : Zip=D:\BIN\OGRE_SDK\OgreSDK\media\packs\OgreCore.zip Setelah itu save dan kembalai ke eclipes untuk melakukan Build All dan melihat exe yang terbentuk.

11 Tampilan Output Ogre


Download ppt "Mata Praktikum GRAFKOM2 Pertemuan-1"

Presentasi serupa


Iklan oleh Google