Hello OpenSG users,

I am still using OpenSG 1.8, wrote a small application to test background 
loading of images and noticed some strange things in the OBJSceneFileType while 
loading *.obj files.

Each *.obj file I am using refers to a common material library where all 
important materials are stored. So the head of an *.obj file looks like that:

-OBJ-FILE-BEGIN---------------------------
mtllib ../materials/materials.mtl

usemtl matX

...
-OBJ-FILE-END-----------------------------

Where matX refers to a material in the given material.mtl and where the dots 
mark the place for geometry definitions.

If I define *.obj files this way, the current implementation of the 
OBJSceneFileType class will create every material in the mentioned material 
library for each *.obj file. So, for example, if I have four *.obj files, each 
with a different material, OpenSG will create 16 materials this way.

To avoid that I changed the OpenSG 1.8 sources by making the variable mtlMap in 
OBJSceneFileType::read() static and by adding trivial checks for already 
existing materials to the method OBJSceneFileType::readMTL(). This didn't 
really fix the problem because my version also creates potentially unimportant 
materials since the material library contains all materials even those not used 
in a particular scene.

Am I doing something wrong here or is this really a bug? I checked the OpenSG 
2.0 sources, too. It seems that *.obj files are still being treated this way.


Cheers
Till



-- 
GRATIS! Movie-FLAT mit über 300 Videos. 
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome

------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to