- Overview
- Video
- Steps
- 1.1.1. Install Blender
- 1.1.2. Create a deformed cube
- 1.1.3. Triangulate the cube: CRITICAL for mobile/web
- 1.1.4. UV unwrap the cube for later texturing
- 1.1.5. Save the model
- 1.1.6. Install Blender-to-OpenSceneGraph exporter
- 1.1.7. Export Blender model to OpenSceneGraph format
- 1.1.8. Take a look at 'box.osgt' file
- Resources
This tutorial is part of OpenSceneGraph cross-platform guide.
In this tutorial we create a simple cube in Blender that OpenSceneGraph will render later.
Video depicts Blender installation under Xubuntu 16.04.
Note: steps below use frames from the video as screenshots. Watch the video to see all details.
To install Blender on Debian based distributions, run the following command:
sudo apt install blender
If you're on macOS or Windows, you can get Blender from its homepage: http://blender.org
We create the deformed cube so that it's easy to know which side we're looking at when we see it rendered later.
Both mobile and web platforms use OpenGL ES to perform 3D rendering, which is different from OpenGL used on desktops. One specific aspect is that mobile and web only render triangles, not quads.
By default, Blender uses quads. That's why we manually triangulate our model to make sure it can be displayed on all platforms.
This is necessary for correct texturing and calculating visual effects in shaders later.
Save the model for later reference.
Install exporter to produce OpenSceneGraph models from within Blender.
Export the model to OpenSceneGraph format.
Exported OpenSceneGraph format (*.osgt
) is a text file.
There also exist binary (*.osg
, *.osgb
) and xml (*.osgx
) formats.
You might want to use them to speed up loading times.