• Advertisement
Sign in to follow this  

Getting texture from problem collada file...

This topic is 2817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I'm writing a game engine and I'm using Collada DOM to load collada files. I've already got the geometry data loading. My problem is I have one model I'm using to test that doesn't seem to have a clear association between the geometry and it's materials or textures.

Most of the models I'm testing with look like I can go through <library_visual_scenes>'s nodes, find ones with <instance_geometry> which will get me geometry data and below that they have <instance_material> with a target I can use to get the material and texture.

The problem child doesn't have <instance_geometry> anywhere. Is there some other method of getting the information I need that I'm just not seeing? I was thinking maybe I could look at the material attribute in <triangles>, but it doesn't match anything useful. I might be able to use the <instance_controller> url attribute and take a dozen steps through the animation data to find the damn geometry, but that looks way more painful than it should be. Is this just a freak occurrence? Am I on the right track with my idea up above with the working example?

I wanted to post examples, but it choked and died. Good thing I cut and pasted it before hitting show preview...

Here's an example of a "good" file:

<?xml version="1.0"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<authoring_tool>Maya 8.0 | ColladaMaya v3.02 | FCollada v3.2</authoring_tool>
<comments>Collada Maya Export Options: bakeTransforms=0;exportPolygonMeshes=1;bakeLighting=0;isSampling=0;
Copyright 2006 Sony Computer Entertainment Inc.
Licensed under the SCEA Shared Source License, Version 1.0 (the
&quot;License&quot;); you may not use this file except in compliance with the
License. You may obtain a copy of the License at:
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
See the License for the specific language governing permissions and
limitations under the License.
<unit meter="0.01" name="centimeter"/>
<camera id="cameraShape1" name="cameraShape1">
<light id="directionalLightShape1-lib" name="directionalLightShape1">
<color>1 1 1</color>
<image id="file2" name="file2">
<material id="blinn3" name="blinn3">
<instance_effect url="#blinn3-fx"/>
<effect id="blinn3-fx">
<newparam sid="file2-surface">
<surface type="2D">
<newparam sid="file2-sampler">
<technique sid="common">
<color>0 0 0 1</color>

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement