'기타/Ogre3D'에 해당되는 글 3건

  1. 2012.12.13 GameKit for iOS build 3
  2. 2012.12.07 Build OGRE for android 5
  3. 2012.12.07 Ogre Source Build 2
기타/Ogre3D2012. 12. 13. 11:26


http://blenderartists.org/forum/showthread.php?155310-GameKit-new-Blender-game-engine-using-Ogre-Bullet-DirectX-OpenGL-Mac-Linux-iPhone&p=1701697#post1701697

I am newbie in the area of opengl and iphone development, but I found this project very interesting and spent a few days to get know it better . Following this steps I successfully run that demo on iPhone Simulator:

  1. xcode - I've downloaded and installed latest Xcode (xcode_3.2.3_and_ios_sdk_4.0.2.dmg) from apple developer page.
  2. cmake - usign existing macports I've installed cmake 2.8.2 (with command line
    Code:
    port install cmake
    ), I suppose that downloading compiled version from http://www.cmake.org/cmake/resources/software.htmlshould be even easier.
  3. source - using svn from command line, in my Documents folder I've executed
    Code:
    svn co http://gamekit.googlecode.com/svn/trunk/ gamekit-read-only
    . And checked out revision nr 615 of the source tree.
  4. crate project - cd into new gamekit-read-only directory, create buil directory and execute cmake
    Code:
    cd gamekit-read-only
    mkdir build && cd build
    cmake .. -G Xcode -D OGREKIT_BUILD_IPHONE=1 -D OGREKIT_BUILD_GLESRS=1
     OGREKIT_BUILD_GLRS=0
  5. build - run Xcode and open and build project OGREKIT.xcodeproj from gamekit-read-only/build/ . Building process took c.a. 20-30 minutes.
I've also tried to run it on real iPad device, with some problems, but finally it worked:
  1. change target config - Targeted Device Family - to iPad
  2. change Architecture i Valid Architecture to armv7
  3. put valid Code Signing Identity
  4. check off Compile for Thumb - I'm not sure if this is right solution, but with this option checked on I got 6 compile errors f.e."error: branch out of range in Engine/AI/gkNavPath.cpp"
Ok, it's working now, but with some issues, I've only tried the "Debug" compile mode, maybe this is the source of some problems.
  • It is staring/loading - 40 seconds.
  • It starts only once, or only run via Xcode and usb cable. After disconecting from mac, and trying to run by pressing app icon it just shows black screen for 40 seconds and switches off.
  • It looks and sounds great, render fast, but it restponds to touch events after 15-20 seconds.

Posted by 삼스
기타/Ogre3D2012. 12. 7. 18:04


http://www.ogre3d.org/tikiwiki/CMake%20Quick%20Start%20Guide?tikiversion=Android

Download the dependencies and extract inside the OGRE src dir. The deps are compiled for armeabi and armeabi-v7a.

http://sourceforge.net/projects/ogre/files/ogre-dependencies-android/1.9/AndroidDependencies.zip/download

  
Windows:

1. Download and install the android sdk
http://developer.android.com/sdk/index.html

2. After the install open the "Android SDK Manager" and download & install your target API. 
Here we target the lowest possible API - which is API10 Android 2.3.3. 
Due the usage of the native activity and the asset manager if we would skip these we could go a bit lower but that would not make much sense because OGRE still needs a decent hardware to run.

3. Now add the install directory to your enviroment variables -> ANDROID_SDK = C:\Users\wolfmanfx\AppData\Local\Android\android-sdk

  • Append %ANDROID_SDK%\tools and %ANDROID_SDK%\platform-tools to your PATH variable

4. Download the android ndk

  • Extract the content to C:/android/ndk and create a env var %ANDROID_NDK%
  • Add %ANDROID_NDK% to your path
http://dl.google.com/android/ndk/android-ndk-r8c-windows.zip
Android NDK revision 8b is not supported due a bug in the toolchain

5. We need ant (http://ant.apache.org/bindownload.cgi) to build projects from the command line

Apache Ant(TM) version 1.8.4 compiled on May 22 2012

6. The build command for the deps (using Visual Studio command prompt)

cmake -G"NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE=..\cmake\android.toolchain.cmake -DANDROID_ABI=armeabi ..
nmake

7. The build command for ogre (for armeabi - if you want to build for armeabi v7a just remove -DANDROID_ABI=armeabi) create a build dir inside the OGRE src tree and cd to this dir and execute this command:

cmake -G"NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE=..\cmake\toolchain\android.toolchain.cmake -DOGRE_DEPENDENCIES_DIR=..\AndroidDependencies -DANDROID_ABI=armeabi -DANDROID_NATIVE_API_LEVEL=9 ..

OSX:

cmake -DCMAKE_TOOLCHAIN_FILE="`pwd`/../CMake/toolchain/android.toolchain.cmake" -DOGRE_DEPENDENCIES_DIR="`pwd`/../AndroidDependencies" -DANDROID_ABI=armeabi -DANDROID_NATIVE_API_LEVEL=9 ..

  


Posted by 삼스
기타/Ogre3D2012. 12. 7. 14:45


OGRE build가이드

오거는 Cmake를 사용한다. 이 가이드는 이에 대한 설명이다.

1. CMake?

CMake는 cross-platform build system이다. CMake script들의 셋으로 native build시스템을 오거 빌드를 위해 만들어준다.

2. CMake는 어디서 나나?

http://www.cmake.org(Resources -> Downloads)에서 구할수 있다. 소스로도 받을 수 있지만 이미 컴파일된 모든 플랫폼의 바이너리들을 다운받을 수 있다. 

3. Dependency들은 어디서 구하나?

freetype lib가 필요한데 그 외에 다른 것들이 더 필요하다. 소스또는 바이너리를 각 배포사이트를 통해서 얻을 수 있다. ogre에서도 몇몇 플랫폼들에 대해서 미리컴파일된 디펜던시들을 별도로 제공하고 있다.

http://www.ogre3d.org/download/source 를 참조하라.

Linux에서는 디펜던시를 바로 설치가 가능하다. Ubuntu Karmic의 경우 다음 명령으로 설치가 가능하다.

> sudo apt-get install libfreetype6-dev libboost-date-time-dev \

>   libboost-thread-dev nvidia-cg-toolkit libfreeimage-dev \

>   zlib1g-dev libzzip-dev libois-dev libcppunit-dev doxygen \

>   libxt-dev libxaw7-dev libxxf86vm-dev libxrandr-dev libglu-dev

해당 디펜던시의 미리컴파일된 바이너리를 구할 수 없다면 아래기술한 리스트를 참조해서 소스를 해당 웹사이트에서 구한 후 직접 빌드해서 사용해야 한다.
필수 디펜던시
* freetype: http://www.freetype.org
권장 디펜던시
* Boost: http://www.boost.org (+)
* Cg: http://developer.nvidia.com/object/cg_toolkit.html
* DirectX SDK: http://msdn.microsoft.com/en-us/directx/
* FreeImage: http://freeimage.sourceforge.net
* zlib: http://www.zlib.net
* zziplib: http://zziplib.sourceforge.net

(+) Boost는 threaded version의 ogre에서 사용된다. boost-thread와 boost-date_time lib만 필요하다. VisualC++의 경우 http://www.boostpro.com에서 설치 가능하다. 대안으로 POCO나 TBB를 사용할 수 있다.

4. 빌드환경 준비
Ogre source가 있는 소스외부에 빌드를 위한 디렉토리를 만들어야 한다. 이 디렉토리는 CMake가 당신이 선택한 플랫폼과 컴파일러 그리고 Ogre lib이 컴파일될 디렉토리이다.
이렇게 하야 Ogre source 디렉토리는 항상 깨끗하게 유지할 수 있고 여러가지 빌드환경을 만들 수 있게 된다.
윈도우환경이라면 'Dependencies'라고 불리는 공통리텍토리에 컴파일된 모든 바이너리들을 모아야 한다. 여기에 bin, lib, include디렉토리가 있어야 하 고 각각 .dll, .lib 그리고 헤더파일들을 위치시켜야 한다(만일 미리컴파일된 바이너리 패키지를 사용한다면 이미 이러한 형태로 만들어져 있을 것이다.)

5. Cmake 실행하기
이제 cmake-gui를 실행해라. 'Where is the source code'필드에 Ogre source 디렉토리를 입력한다. 'Where to build the binaries"필드에 4.에서 생성한 빌드디렉토리를 입력한다.
'Configure'를 누른다. generator중 하나를 선택하라는 대화상자가 뜬다. 원하는 platform과 compilier를 선택한다. Unix에서는 'Unix Makefiles'를 VisualStudio는 해당하는 버전과 (Win32 | Win64)를 그리고 애플은 Xcode를 선택한다.
'Finish'를 누른다. CMake는 이제 빌드환경에 대한 정보들을 수집하고 의존성들을 배치할것이다. 
이 때 빌드옵션들을 보여줄것이다. 이 때 링크설정을 변경할 수 있는데 예를 들어서 OGRE_BUILD_XXX옵션을 켜거나 끌수 있다. 한번 설정이 다 되면 'Configure'를 다시한번 누르고 'Generate'를 누른다. 그러면 CMake가 빌드시스템을 만들어 준다.
의존성 배치 -> 만일 의존성관련해서 에러가 나면(3.을 잘 수행했음에도 불구하고), CMake가 어딜 바라보고 있는지 확인해야 한다. Unix의 경우 CMake는 standard location들에 설치되었다면 모든 의존성을 찾을 수 있어야 한다.  만일 4.의 절차를 정상적으로 수행하였다면 OGRE_DEPENDENCIES_DIR에 디렉토리가 정상적으로 지정되었는지 확인해야 한다. 그렇지 않으면 각 의존성별로 디렉토리를 설정해주어야 한다. 'Add entry'를 선택하고 CMake variable을 추가하면 되는데 'PATH'를 선택한다. variable의 이름은 XXX_HOME인데 XXX는 각 의존성패키지명이다(ex: ZLIB_HOME, ZZIP_HOME, FREETYPE_HOME). 각 디렉토리들을 입력하고 'Ok'를 누른다. 설정이 끝났으면 'Configure'를 다시 진행한다.

6. Ogre 빌드하기
빌드디렉토리로 이동한다. CMake는 빌드시스템을 하나 만들었다. VisualStudio를 사용한다면 OGRE.sln이 생겼을 것이다. 이 파일을 열고 'BUILD_ALL'타겟을 컴파일해보아라. MacOS에서는 xcode project가 생겼을 것이다. 이를 열어서 빌드해보아라.
Makefile generator를 선택하였다면 console을 열고  빌드디렉토리로 이동해서 make를 호출해라.
> make
doxygen이 설치되어 있다면 다음 명령으로 API문서를 생성할 수 있다.
> make doc

7. Ogre 설치하기
빌드가 성공하면 빌드된 라이브러리와 헤더들을 따로 관리할 수 있다.  VisualStudio에서 'INSTALL'타겟으로 빌드를 하면 'sdk'폴더를 만들고 거기에 복사한다. Makefile 빌드에서는 >make install or >sudo make install로 설치할 수 있다. 리눅스에서는 /usr/local에 설치하게 되는데 이걸 바꾸고 싶다면 CMAKE_INSTALL_PREFIX를 수정하면 된다.

8. MacOS에서 iOS향으로 빌드하기
cmake-gui에서 OGRE_BUILD_PLATFORM_APPLE_IOS를 확인해야 함. 불행히도 몇가지 옵션을 수동으로 해주어야 한다.
빌드디렉토리에 xcode project가 생성되어있기 때문에 ogre를 빌드하려면 OGRE.xcodeproj를 열고 빌드하면 된다. 단말에서 돌릴려면 아시다시피 개발다 인증서가 설치되어야 한다.
CMake가 당신이 어떤 Xcode project format을 원하는지 알수 없기 때문에 당신이 직접 수정해야 한다. Project메뉴를 열어서 Edit Project Setting를 선택해라. General tab을 선택하고 Project Format을 Xcode 3.1-compatible로 변경해라.
또 다른하나는 Info.plist에서 bundle ID를 수정하는것이다. 이것은 Code signing id와 연관되며 이와 관련된 설정은 여기서 다루지 않는다. 이에 대한 자세한 정보는 http://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iphone_development/index.html
 를 참조하라.



Posted by 삼스