[osg-users] [osgPlugins] OpenFlight-Plugin - Subfaces could notbe read by OpenFlight-API

Paul Martz pmartz at skew-matrix.com
Tue Mar 3 07:44:02 PST 2009

Thanks, this post from you has reminded me of some of the issues.

Quick summary / bottom line: The OpenFlight spec states that subfaces must
come after the base faces. The exporter doesn't change the ordering; for
now, you'll need to ensure that your subfaces come after the base faces.

The primary intent of the FLT exporter was to support files that had been
loaded from FLT, possibly modified in OSG, then exported back to FLT. In
this usage case, the Geometry was already in the correct order for proper

Could we modify the exporter to produce the correct ordering? Well, yes and
no. It's theoretically possible to rearrange the order to meet this FLT spec

However, the spec has other requirements as well, such as: the base Face
must be large enough to completely cover the area of all subfaces. I hope
you agree that the exporter should _not_ check for an adequate base Face
size, and enlarge it if necessary. :-)

Ultimately, my philosophy is that the exporter should simply export the
scene graph that it is given, without trying to be "smart" about it. I'd
rather see a NodeVisitor that walks a scene graph and "preps" it for FLT
export, possibly displaying warnings if it detects situations that it can't
resolve. Because exporting is a const operation, this NodeVisitor would have
to be run by the application prior to export, so it would need to live in
osgUtil or osgSim, for example.

If you would like to write a NodeVisitor to change the order of subface
geometry, this would be a good start on a "FLT export prep" NodeVisitor.
Perhaps Robert would add it to OSG.

Paul Martz
Skew Matrix Software LLC
+1 303 859 9466

-----Original Message-----
From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Katharina
Sent: Monday, March 02, 2009 9:16 AM
To: osg-users at lists.openscenegraph.org
Subject: Re: [osg-users] [osgPlugins] OpenFlight-Plugin - Subfaces could
notbe read by OpenFlight-API

Sorry for triple posting, but i have some new findings:

Correctly reading in Subfaces with the OpenFlight API is dependent on the
node sequence.

- child1 = Subface Node
- child2 = Other Geometry

does not produce a subface in the API. Where as

- child1 = Other Geometry
- child2 = Subface Node

leads to the desired result. 

Do I have to garantee in osg, that the order of the nodes is correct before
exporting to flt, or could the plugin be adjusted to put subface childs
last? The latter would help to avoid invalid results in future for people
who are not aware of the problem. 



Read this topic online here:

osg-users mailing list
osg-users at lists.openscenegraph.org

More information about the osg-users mailing list