OSG on Android

1.     Building OSG on Android

  • Unzipp osg  in C :
  • Unzipp 3rd party folder inside osg folder.
  • Create a new folder in C :  OpenSceneGraph-3.0.1-build
  • Create a new folder in C :  OpenSceneGraph-3.0.1-install
  • Create a file named build.sh  in OpenSceneGraph-3.0.1-build having the following content :
PATH=$PATH:"/c/Program Files/Java/jdk1.7.0_03/bin/":/c/android/android-sdk/tools:/c/android/android-sdk/platform-tools:/c/android/ndk
export PATH
  • Open msys in the OpenSceneGraph-3.0.1-build folder  and then execute  ./build.sh
  • Execute mingw32-make install (you may need to delete “wordlist” in the Android source)

2.     Compilation of osgAndroidExampleGLES1 (include in the osg folder)

  • Open the project in Eclipse
  • Edit Android.mk :
    • Line 7 :
      OSG_ANDROID_DIR       := < type your install directory >

In our case it’s ” /c/OpenSceneGraph-3.0.1-install ”

  • Line 21 : replace it by
LOCAL_LDLIBS    := -llog -lGLESv1_CM -ldl -lz -lgnustl_static
  • Open cygwin and in the folder osgAndroidExampleGLES1 execute this command to update build.xml :
$ANDROID_SDK/tools/android.bat list targets
  • Review the list of target Android and save the ID, in our case it’s number 1. Execute the following command:
$ANDROID_SDK/tools/android.bat update project -t 1 -p . -s
  • Now we open Msys and go through the folder osgAndroidExampleGLES1 in the workspace and execute

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s