OpenSceneGraph is an open source high performance 3D graphics toolkit, used by application developers in fields such as visual simulation, games, virtual reality, scientific visualization and modelling.
This document is a logical continuation of OpenSceneGraph cross-platform guide. Here you'll find a collection of examples to perform specific tasks.
Examples run on the following platforms:
Note: Windows builds have not yet been tested.
Each example uses OpenSceneGraph. OpenSceneGraph is built as part of each example: examples don't use OpenSceneGraph libraries built separately, instead each example includes OpenSceneGraph sources directly. This was necessary to simplify building OpenSceneGraph across platforms. Here's custom CMakeLists.txt we use to build OpenSceneGraph across platforms (excluding iOS).
Certain examples use other libraries like Mongoose and libpng-android to achieve specific functionality. Those libraries are part of corresponding examples, too.
Each example contains four implementations to cover all supported platforms:
Let's see how to build the first example for each platform.
Notes:
To build the first example, run the following commands:
cd 01.EmbedResource/desktop
mkdir build
cd build
cmake ..
make
To launch the first example, run the following command:
./ex01-embed-resource
Notes:
armeabi-v7a
architecture by default
abiFilters
value in android/app/build.gradle
if you want other platformsTools -> Android -> Sync Project with Gradle Files
in Android Studio after opening a project, this is necessary for Android Studio to create internal project filesTo build and run the first example for Android, open
01.EmbedResource/android
in Android Studio and run the project.
To build and run the first example for iOS, open
01.EmbedResource/ios/ex01.xcodeproj
in Xcode and run the project.
To build the first example for web, run the following commands:
cd 01.EmbedResource/web
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/emsdk/emscripten/<version>/cmake/Modules/Platform/Emscripten.cmake ..
make
Notes:
To launch the first example, open ex01-embed-resource.html
file in Firefox.
To launch the example in any web browser, you need to serve example files with a web server.
If you have have Python installed, here's what you need to do:
serve example with a web server:
cd 01.EmbedResource/web/build
python -m SimpleHTTPServer
ex01-embed-resource.html
fileLearn how to embed a binary resource into application with xxd
Unix utility
and use the resource across platforms.
Learn how to use PNG images across platforms with PNG plugins.
Learn how to implement HTTP client across platforms to perform GET/POST requests.
Learn how to work with debug-broker to perform remote debugging.
Learn how to select a node.
Learn how to compose a sequence of asynchronous commands to combine animations with other operations.
Feel free to ask questions in the issues. Your questions help us improve examples.