Robert,

At the moment the OBJ loader builds a material to stateset map, which is
indexed by the material name. However when the stateset is applied to a
geometry, the material name is effectively lost.

Also the OBJ loader reads the group name (i.e. "g groupname" in the .obj)
and any object name (i.e. "o objectname" in the .obj). For any "g" field in
the OBJ file, it creates a new geode under the toplevel group, with a name
as in the form "groupname:objectname"

You should be able to see this visually by converting models into .osg and
reading the results.

However, the OBJ writer outputs everything as "o objectname", and doesn't
preserve groups at all.

Unfortunately, I think that what you want is not possible with the OBJ
loader coded as it is. I think you (or someone) might need to dive in and:

1) Attach a loaded material name to a stateset on loading
2) Output things as "g geodename" rather than "o geodename". Probably ditch
the writing (and reading?) of object completely.
3) The code for actually outputting material names seems to still be there.

IMplementing (1) would not break any body elses code. Implementing (2),
however, might. Does anybody actually use "o objectname" in their modelling
pipeling? From the spec, Wavefront claims to ignore this anyway...

Regards,

David
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to