3D Model

The 3d model render extension renders a 3d model into the control. Currently models in Wavefront Object (.obj) format are supported. This extension is only available when using OpenGL or OpenGL ES 2.0 based render managers, and requires the model3d plugin to be loaded.

The coordinate system in the render extension is the default OpenGL default coordinate system, with positive x to the right, positive y up, and positive z towards the viewer. The camera position defaults to (0, 0, 0), with the view direction along the negative z axis.

A Phong reflection model is implemented. A directional light source is present with white light coming from the (0, 1, 1) direction. The Phong model makes use of three terms:

For more details on the Phong reflection model refer to Phong Reflection Model or to any book on computer graphics.

Rotations for the model are defined using Euler angles, with rotations applied around the z (psi), y (theta) and then x (phi) axes.

An OBJ file defines vertices and faces, and optionally normals and texture coordinates. If normals are not present, they will be calculated according to the convention that vertices in a face are specified in counter-clockwise order. If texture coordinates are not present, the model will not be rendered using a texture. Faces may be grouped together, and each group may be rendered with a different material.

Each OBJ file may also specify a Material (.mtl) file which allows for the material properties of the model to be specified. The following properties in a material file are currently supported:

If a material file is not present, the object will be rendered with a white color.

The 3D model render extension uses many standard options but also includes:

Filename

The name of the model to load.

Camera Position X/Y/Z

The X/Y/Z position of the camera.

Azimuth

The rotation of the camera around the y axis in degrees.

Elevation

The rotation of the camera around the x axis in degrees.

Field Of View

The field of view the camera in degrees. The field of view specifies how much of visual sphere is mapped to the control. A larger field of view is equivalent to using a wide-angle lens on a camera, and a smaller field of view is equivalent to using a zoom lens.

Model X/Y/Z

The X/Y/Z position of the model.

Orientation Phi

The rotation of the model around the x axis in degrees.

Orientation Theta

The rotation of the model around the y axis in degrees.

Orientation PSI

The rotation of the model around the z axis in degrees.