Textures are supported. The issue is most likely in the google sketchup export. Last I knew their export was far from compliant. I don't think they have released a newer version but I do know that we have been helping them achieve a better level of compliance.
Also, the plugin does have code to handle images and materials. It's in the daeRMaterials.cpp file. The program flow goes from processBindMaterial to processMaterial to processEffect to processProfileCommon (the only effect type supported at the moment) to processColorOrTextureType to processTexture. processTexture is where the plugin handles COLLADA image elements. There is a limitation though that the only texture that will be used needs to be specified in the <diffuse> element in the COLLADA profile_COMMON effect. So one major problem with sketchup output is that they didn't use the <bind_material> elements. Well if you don't bind a material to a geometry you will not have a material. So the plugin is behaving correctly. We did make a program that fixes sketchup COLLADA files so they can be loaded in other tools, including the osgplugin. I was using fixed up models from the 3DWarehouse as test cases while developing the plugin. You can find that program here: http://sourceforge.net/project/showfiles.php?group_id=157838&package_id=199800 You can also load a model from the sample data package available from collada dom sourceforge project. The plugin doesn't support skinning but you can load the seymour.dae or seymourplane.dae and see that texturing does work. Ok this time I decided to test before I "spoke" and well the problem with Sketchup is probably still your culprit but I was surprised to see that texturing has been broken since I donated the code. Good thing is that I know what the problem is and was able to fix it. In daeRMaterials.cpp line 466 std::string filename = (dImg->getInit_from()->getValue().getURI()+7); needs to be changed to std::string filename = (dImg->getInit_from()->getValue().getURI()+8); The +8 is used to strip file:/// from the front of the URI used to locate the image file. Having +7 leaves the first / which then causes the image not to be found. Whoever made that change, why? I am wondering if this is a portability issue and +7 is needed for some platforms +8 others. -Andy Roger James wrote: > I tried a model exported from sketchup with textures and they don’t appear, > nor do any of the materials. > > A quick look through the code confirmed that the collada plugin does not > support textures yet. It has no support for library_images or for materials > specified at the geometry primitive level. It seems only to support non > image materials bound at the per geometry level. > > However, Andy Lorino's presentation at Siggraph > http://openscenegraph.org/osgwiki/uploads/Documentation/osgbof_siggraph2006_ > COLLADA.pdf seems to imply textures should be supported. > > Maybe I missed something? > > Roger > >> -----Original Message----- >> From: [EMAIL PROTECTED] [mailto:osg-users- >> [EMAIL PROTECTED] On Behalf Of Sébastien Grignard >> Sent: 28 September 2006 10:00 >> To: osg users >> Subject: [osg-users] Collada plugin and textured models >> >> Hi all. >> I tried OSG 1.2 with the collada/dae ReaderWriter, but when I convert a >> textured model (like cow.osg or skydome.osg) the geometry is correctly >> converted but the texture is not applied. >> Looking at the output dae file I don't see any reference to a texture >> (except texture coordinates). >> Is it that the dae plugin doesn't support textured models writing or am >> I missing something ? >> >> Thanks. >> >> -- >> Sebastien Grignard >> R&D Developer >> Archivideo >> 40, rue des Veyettes - 35000 Rennes FRANCE >> Phone: +033 2 99 86 30 20 >> >> _______________________________________________ >> osg-users mailing list >> [email protected] >> http://openscenegraph.net/mailman/listinfo/osg-users >> http://www.openscenegraph.org/ > > > _______________________________________________ > osg-users mailing list > [email protected] > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
