GamePrograming
-
단일체 패턴 (Singleton) - JAVA 예제GamePrograming/내가본 GPG_One 2009. 11. 16. 14:51
1) EagerSingleton static class EagerSingleton extends Singleton { static final EagerSingleton theInstance = new EagerSingleton(); static EagerSingleton getInstance() { return theInstance; } } 이 경우는 미리 싱글톤 인스턴스를 생성하는 방법으로 static final 필드에 인스턴스를 생성하여 할당하는 방법입니다. 이 필드는 클래스로더에 의해서 EagerSingleton이 메모리로 올라오는 순간에 안전하게(thread-safe하게)초기화 됩니다. 이 방법이 아마 성능이 가장 우수하게 나타날 것입니다. 장점은 동기화부담이 적다는 것입니다. 단 한번 클래스..
-
OGRE3D Tutorial.03 카메라 뷰포트 설정GamePrograming/Orge Engine 2009. 10. 9. 13:22
Tutorial Basic Setup New Project -> OGRE SDK Application -> Minimal application "프로젝트 속성 -> 구성속성 -> C/C++ -> 일반 -> 추가 포함 디렉터리" 항목에 "$(OGRE_HOME)\samples\include" 을 추가한다. #include "ExampleApplication.h" class OgreTestApp : public ExampleApplication { public: OgreTestApp() { } ~OgreTestApp() { } protected: void createCamera(void) { mCamera = mSceneMgr->createCamera("PlayerCam"); mCamera->setPositi..
-
OGRE3D Tutorial.02 물체 띄우기GamePrograming/Orge Engine 2009. 10. 8. 17:47
SceneManager Basics Everything that appears on the screen is managed by the SceneManager (fancy that). When you place objects in the scene, the SceneManager is the class which keeps track of their locations. When you create Cameras to view the scene (which we will cover in a later tutorial) the SceneManager keeps track of them. When you create planes, billboards, lights...and so on, the SceneMan..
-
OGRE3D Tutorial.01 기본화면 띄우기GamePrograming/Orge Engine 2009. 10. 8. 17:06
New Project -> OGRE SDK Application -> Minimal application "프로젝트 속성 -> 구성속성 -> C/C++ -> 일반 -> 추가 포함 디렉터리" 항목에 $(OGRE_HOME)\samples\include" 을 추가한다. "프로젝트 속성 -> 구성속성 -> 디버깅 -> 작업 디렉터리" 항목에 $(OGRE_HOME)\bin\debug 추가 "도구 -> 옵션 -> 프로젝트 및 솔루션 -> VC++ 디렉터리" 포함 파일과 라이브러리 파일 추가 {PROJECT_NAME}.cpp 파일 보기 // Create application object //OgreTestApp app; try { //app.go(); } catch( Ogre::Exception& e ) { //주석..
-
OGRE3D 초기 셋팅GamePrograming/Orge Engine 2009. 10. 8. 16:09
2. 필요한 자료들 Visual Studio 2005 Kor Team Suite VS80sp1-KB926605-X86-KOR.exe (비주얼 스튜디오 2005 서비스팩 1 필수!) OgreSDKSetup1.4.9_VC80.exe (OGRE3D SDK 1.4.9 for Visual Studio 2005 SP1) ogresdkwizard80_Eihort_v1_4_2.zip (OGRE3D Project Wizard for Visual Studio 2005) 3. 설치 방법 먼저 비주얼 스튜디오 2005 이미지를 넣고 설치를 합니다. 설치 할때에 다른건 설치할 필요 없고 C++만 설치하면 됩니다.설치를 마쳤으면, VS80sp1-KB926605-X86-KOR.exe 를 실행하여 서비스팩을 설치합니다. 서비스팩 설..
-
사원수를 이용한 로테이션GamePrograming/Direct3D 2009. 6. 25. 12:26
a.end = D3DXVECTOR3(0.0f, 0.0f, 400.0f); D3DXVECTOR3 dot3(1.0f, 0.0f, 0.0f); D3DXVECTOR3 vAxis(0,1,0); float fAngle = acos(D3DXVec3Dot(&a.end, &dot3) / (D3DXVec3Length(&a.end)* D3DXVec3Length(&dot3))); D3DXQUATERNION q; D3DXQuaternionRotationAxis(&q, &vAxis,fAngle); inverseRotate(q,a.end); void inverseRotate(D3DXQUATERNION& q, D3DXVECTOR3 & v) { D3DXQUATERNION myInverse; myInverse.x = -q.x;//*ms..