Thread: Collada
View Single Post
Old 7th October 2009, 05:40 PM   #26
Dennis
Senior Member
Professional user
 
Dennis's Avatar
 
Join Date: Jul 2003
Posts: 899
Default Re: Collada

Andy/Inivis,

I pulled the Blue Mars dev kit so I could run the import with AC3D test data, and I think I've found the issues.

I've attached 2 AC3D Collada exports - one is a textured triangle created with AC3D (actri.dae) and the other is an edited version of that triangle (actri_EDITED.dae). The edited version contained indented/spaced/commented code that handles material/texture data that Blue Mars was erroring on.

Note that these changes also allow the materials and textures to show up when I import this into LightWave --- without the changes, the material colors/textures don't show. I can't guarantee that LightWave is doing everything correctly, of course, but it's the most trustworthy Collada importer that I own.

The changes that were made to make this import correctly into LightWave follow. Just to stress this, the import already worked for geometry, but materials/textures weren't showing up, and UV maps weren't being applied.
  1. Added a <library_images> tag to specify a texture.
  2. Updated the <library_effects>'s <profile_COMMON> tag to describe the texture format/source.
  3. Updated the <library_effects>'s <profile_COMMON>'s common techique <diffuse> tag to include the texture description.
  4. Updated the <visual_scene>'s <instance_geometry> tag to bind the material and texture coordinates to the mesh.

Beyond this, I made one other change that may be a problem with the Blue Mars importer. If the texture coordinate accessor is assigned to X/Y, Blue Mars apparently gets confused, probably with the position or normal array, but setting these coordinates to any other value worked (I used S/T). However, I don't see that using a different nomenclature than X/Y hurts anything, and I also notice that other Collada exporters do the same.

Gus,

I'm not sure whether these changes will be trivial to introduce into the exporter - it was very easy when the geometry consisted of only a single triangle, but in order to support more complex scenes it might not be that easy.

Here's hoping it turns out to be an easy fix, though .

Dennis
Attached Files
File Type: txt actri.dae.txt (2.8 KB, 337 views)
File Type: txt actri_EDITED.dae.txt (4.2 KB, 341 views)
Dennis is offline   Reply With Quote