[COLLADA] Why TEXCOORD and VERTEX counts are different?

ColladaImporter has some bugs and now I'm fixing it.

But I am lack of mesh structure.

Please give me some insight.

Thanks in advance.



When I export some objects, sometimes they have different count for VERTEX and TEXCOORD.

In the collada file below, vertex and normal has 228 counts.

but texcoord has 302 counts.

What it means?

If one vertex has only one texcoord, (assuming mesh has just one texture channel)

texcoord count will be the same or smaller than vertex count.

In which point am I wrong?



<geometry id="objaddballoon-mesh">
      <mesh>
        <source id="adballoon-positions">
          <float_array id="adballoon-positions-array" count="684">-29.996849 20.905350 ... </float_array>
          <technique_common>
            <accessor source="#adballoon-positions-array" count="228" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="adballoon-normals">
          <float_array id="adballoon-normals-array" count="684">-0.275096 0.664138 0.695157 ...</float_array>
          <technique_common>
            <accessor source="#adballoon-normals-array" count="228" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="adballoon-map-channel1">
          <float_array id="adballoon-map-channel1-array" count="906">0 0.875000 0 ... </float_array>
          <technique_common>
            <accessor source="#adballoon-map-channel1-array" count="302" stride="3">
              <param name="S" type="float"/>
              <param name="T" type="float"/>
              <param name="P" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="adballoon-map-channel1-tangents">
          <float_array id="adballoon-map-channel1-tangents-array" count="672">-0.951610 -0.291108 -0.098464 ... </float_array>
          <technique_common>
            <accessor source="#adballoon-map-channel1-tangents-array" count="224" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="adballoon-map-channel1-binormals">
          <float_array id="adballoon-map-channel1-binormals-array" count="195">0.136972 -0.688605 0.712083 ...</float_array>
          <technique_common>
            <accessor source="#adballoon-map-channel1-binormals-array" count="65" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <vertices id="adballoon-vertices">
          <input semantic="POSITION" source="#adballoon-positions"/>
        </vertices>
        <triangles material="_1_-_Default" count="448">
          <input semantic="VERTEX" source="#adballoon-vertices" offset="0"/>
          <input semantic="NORMAL" source="#adballoon-normals" offset="1"/>
          <input semantic="TEXCOORD" source="#adballoon-map-channel1" offset="2" set="1"/>
          <input semantic="TEXTANGENT" source="#adballoon-map-channel1-tangents" offset="3" set="1"/>
          <input semantic="TEXBINORMAL" source="#adballoon-map-channel1-binormals" offset="4" set="1"/>
          <p>18 0 2 0 0 2 1 3 1 1 1 2 0 2 1 1 2 0 2 1 17 3 1 3 0 18 0 2 0 0  ... </p>
        </triangles>
      </mesh>
    </geometry>

I posted this question to collada.org and got the reply from remi



probably some texcoord are shared
the <p> element is the indirection into the VERTEX and TEXCOORD. it would be an error only if it would address outside of TEXCOORD array size.



actually, Texture coordinate is not shared.
I guess it is collada exporter's bug.