Skip to content

Latest commit

 

History

History

1.1.CreateCube

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Table of contents

This tutorial is part of OpenSceneGraph cross-platform guide.

In this tutorial we create a simple cube in Blender that OpenSceneGraph will render later.

YouTube | Download

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.

Screenshot

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

Screenshot

We create the deformed cube so that it's easy to know which side we're looking at when we see it rendered later.

Screenshot

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.

Screenshot

This is necessary for correct texturing and calculating visual effects in shaders later.

Screenshot

Save the model for later reference.

Screenshot

Install exporter to produce OpenSceneGraph models from within Blender.

Screenshot

Export the model to OpenSceneGraph format.

Screenshot

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.