Presentation is loading. Please wait.

Presentation is loading. Please wait.

Game Programming 02 - OGRE3D 엔진 소개 2010 년 2 학기 디지털콘텐츠전공.

Similar presentations


Presentation on theme: "Game Programming 02 - OGRE3D 엔진 소개 2010 년 2 학기 디지털콘텐츠전공."— Presentation transcript:

1 Game Programming 02 - OGRE3D 엔진 소개 2010 년 2 학기 디지털콘텐츠전공

2 OGRE3D 엔진의 소개 역사 라이센싱 개발 환경의 설치 데모 프로그램 컴파일 및 실행

3 3D 엔진의 종류 3D 엔진 데이타베이스 (http://www.devmaster.net/engines/)http://www.devmaster.net/engines/ – 등록된 엔진은 모두 242 개. – 엔진별 성능, 특징, 및 사용자들의 리뷰가 가득. – 주로 공개 엔진에 대한 정보가 주류.

4 OGRE : 공개 엔진 중 1 위

5 오우거 (OGRE) ? 유럽 판타지문학에 자주 등장하 는 흉악한 종족. 사람을 잡아먹는 흉측한 몬스터. 사람보다 몸집이 약간 크며 거인 과 달리 머리에 뿔이 나 있다. 무기와 방어도구를 비교적 익숙 하게 사용하지만 그렇다고 머리 가 좋은 것은 아니다. 무기도 기껏 해야 곤봉정도. 오크를 부하로 거 느리는 경우가 많다.

6 OGRE 3D 엔진 소개 OGRE 소개 –Object-oriented Graphics Rendering Engine 의 약자 –2001 년 영국의 Steve 'sinbad' Streeting 라는 소프트웨어 엔 지니어가 개발을 시작 – 현재 v1.7.1 까지 진행됨 (2010 년 4 월 release) – 객체지향인터페이스 방식의 설계를 통한 깔끔하고 간결한 엔진 클래스 및 인터페이스 –Direct3D 와 OpenGL 의 동시 지원 – 확장용이한 프레임웍 구조를 통한 쉽고 빠른 애플리케이션 제작 – 다양한 플랫폼 지원 : 윈도우, 리눅스, 맥 OS, iPhone

7 OGRE 3D 엔진 소개 OGRE 는 그래픽스 렌더링 및 애니메이션 엔진 – 인공지능 엔진, 물리 엔진 등을 포함하는 full 3D game engine 은 아님 – 같이 사용될 수 있는 다양한 물리 엔진, AI 엔진, 사운드 엔진 등이 존재함. –YAKE(www.yake.org): OGRE 를 기반으로 하는 공개 소스 3D 게 임 엔진

8 OGRE 3D 엔진 소개 OGRE 의 라이센싱 모델 –GNU LGPL (Lesser General Public License) – 상용 개발에 사용이 가능 – 상용 프로그램과 동적 링킹이 가능함.

9 www.ogre3d.orgwww.ogre3d.org : 공식 홈페이지

10 Screenshot

11

12

13 OGRE 3D 구조

14 OGRE 개발 환경 컴파일러 –Visual Studio 2005/2008/2010 –2005/2008 needs to have service pack 1 installed OGRE 엔진 –OGRE SDK ver. 1.7.1 – 위치 : http://www.ogre3d.org/download/sdkhttp://www.ogre3d.org/download/sdk 데모 및 툴 –OGRE 엔진 데모 - http://www.ogre3d.org/download/demos

15 How to install the OGRE SDK After download the file, extract it onto c:\OgreSDK\ Set an environment variable ‘OGRE_HOME’ :

16 Setting up an application http://www.ogre3d.org/tikiwiki/Setting+Up+An+A pplication+-+Visual+Studiohttp://www.ogre3d.org/tikiwiki/Setting+Up+An+A pplication+-+Visual+Studio

17 Setting up an application Win32 Application with an empty project

18 Setting up an application Download TutorialFramework.zip Insert those files into the project

19 Project Configuration Download TutorialFramework.zip Insert those files into the project

20 Setting up properties

21 Set Multi-Byte Character Set

22 Setting up properties Debugging Configuration Properties –Command: $(OGRE_HOME)\Bin\$(Configuration)\$(ProjectName).exe –Working Directory: $(OGRE_HOME)\Bin\$(Configuration)

23 Setting up properties Configuration Properties - C/C++ - General –Additional Include Directories $(OGRE_HOME)\include\OIS $(OGRE_HOME)\include\OGRE $(OGRE_HOME)\Samples\Common\include $(OGRE_HOME)\boost_1_42

24 Setting up properties Configuration Properties - Linker – General –Additional Library Directories $(OGRE_HOME)\lib\$(Configuration) $(OGRE_HOME)\boost_1_42\lib

25 Setting up properties Configuration Properties - Build Events - Post- Build Event –Command Line copy "$(OutDir)\$(TargetFileName)" "$(OGRE_HOME)\Bin\$(Configuration)"

26 Setting up properties Configuration Properties - Linker - Input – –Additional Dependencies DEBUG: OgreMain_d.lib OIS_d.lib RELEASE: OgreMain.lib OIS.lib

27 And Run it! NOTHING!

28 Edit the code a little bit void TutorialApplication::createScene(void) { // create your scene here :) Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh"); Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(); headNode->attachObject(ogreHead); // Set ambient light mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5)); // Create a light Ogre::Light* l = mSceneMgr->createLight("MainLight"); l->setPosition(20,80,50); } void TutorialApplication::createScene(void) { // create your scene here :) Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh"); Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(); headNode->attachObject(ogreHead); // Set ambient light mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5)); // Create a light Ogre::Light* l = mSceneMgr->createLight("MainLight"); l->setPosition(20,80,50); }

29 And then Run it again!

30 Or Alternatively Download Ogre AppWizard At: http://code.google.com/p/ogreappwizards/http://code.google.com/p/ogreappwizards/

31 Using the Ogre AppWizard Like an ordinary Win32/MFC Project selecting an Ogre Application at a New Project:

32 Using the Ogre AppWizard Application Setting:

33 Using the Ogre AppWizard Run it!

34 How to learn to use OGRE? http://www.ogre3d.org/tikiwiki/Tutorials

35 Want to enjoy OGRE? Download the demos:

36 Want to enjoy OGRE? Play it!

37 숙제 OGRE 3D 를 인스톨하고, 실행 한 뒤 Screenshot 을 찍어서 제출 OGRE 3D Demo 중 흥미 있는 데모 5 개를 선택 하여 Screenshot 을 찍은 뒤 선택한 이유 및 그 데 모에 사용된 기술에 대해 조사 제출 방법 : 문서 하나로 만든 뒤 moodle 에 제출 (doc, hwp, pdf) 제출 시한 : 4 월 16 일 목요일 23 시 59 분까지

38 Basic of OGRE Scene Manager: –Managing everything appearing in the scene –Cameras, Objects, Planes, billboards, lights...and so on 3 kinds of Scene Managers –Octree(8 진 트리 ) Scene Manager 기본 장면 관리자 대부분의 장면에 사용 가능 –BSP(Binary Surface Partition) Scene Manager 건물 내부와 같이 벽과 복도 등으로 구성된 장면에 최적화된 성능. –Terrain Scene Manager 정적 지형을 가지는 비교적 소규모의 장면에 적합 고해상도의 지형에 적합 mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC);

39 Basic of OGRE Entity: –Objects to be rendered on the scene –3D meshes: Character, robot, fish, terrain and so on. –Cameras, lights, billboards are not entities. 3D Mesh

40 Basic of OGRE Scene Node: –Representing translation, rotation and scale (transformation) –Not an actual object –An(or multiple) entity can be attached to. Node Entity1 Entity2

41 Scene Manager, node and entity root Node1 Node2 Entity1 Entity2 Entity3 Node3 Entity4 Entity5 Node4 Entity6

42 Hierarchical Modeling A hierarchical model is created by nesting the descriptions of subparts into one another to form a tree organization

43 Revisiting the code void TutorialApplication::createScene(void) { // create your scene here :) Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh"); Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(); headNode->attachObject(ogreHead); // Set ambient light mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5)); // Create a light Ogre::Light* l = mSceneMgr->createLight("MainLight"); l->setPosition(20,80,50); } void TutorialApplication::createScene(void) { // create your scene here :) Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh"); Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(); headNode->attachObject(ogreHead); // Set ambient light mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5)); // Create a light Ogre::Light* l = mSceneMgr->createLight("MainLight"); l->setPosition(20,80,50); }

44 Adding One More Node void TutorialApplication::createScene(void) { // create your scene here :) Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh"); Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(); headNode->attachObject(ogreHead); Ogre::Entity* ogreHead2 = mSceneMgr->createEntity( "Head2", "ogrehead.mesh" ); Ogre::SceneNode* headNode2 = mSceneMgr->getRootSceneNode()->createChildSceneNode ( "HeadNode2", Ogre::Vector3( 100, 0, 0 ) ); headNode2->attachObject( ogreHead2 ); // Set ambient light mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5)); // Create a light Ogre::Light* l = mSceneMgr->createLight("MainLight"); l->setPosition(20,80,50); } void TutorialApplication::createScene(void) { // create your scene here :) Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh"); Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(); headNode->attachObject(ogreHead); Ogre::Entity* ogreHead2 = mSceneMgr->createEntity( "Head2", "ogrehead.mesh" ); Ogre::SceneNode* headNode2 = mSceneMgr->getRootSceneNode()->createChildSceneNode ( "HeadNode2", Ogre::Vector3( 100, 0, 0 ) ); headNode2->attachObject( ogreHead2 ); // Set ambient light mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5)); // Create a light Ogre::Light* l = mSceneMgr->createLight("MainLight"); l->setPosition(20,80,50); }

45 Node Transformation Translate: –SceneNode::translate ( Ogre::Vector3(..) ); Rotate: –SceneNode::yaw(Degree(..)); –SceneNode::pitch ( ); –SceneNode::roll ( ); Scale –SceneNode::scale ( x, y, z );

46 Cool ninja without hassle Replace the CreateScene function with the one in our homepage!

47 정리 OGRE 3D 의 rendering process: – 시스템 초기화 Root 개체 생성 컨피규레이션 설정 렌더 윈도우 생성 리소스 위치 설정 프레임 리스너 생성 – 씬 생성 씬 매니저 생성 카메라 및 뷰포트 생성 광원 생성 엔터티 생성 씬 노드 생성 – 렌더링


Download ppt "Game Programming 02 - OGRE3D 엔진 소개 2010 년 2 학기 디지털콘텐츠전공."

Similar presentations


Ads by Google