Results 1 to 4 of 4

Thread: why TEXCOORD and VERTEX counts are different?

  1. #1
    mulova
    Guest

    why TEXCOORD and VERTEX counts are different?

    Hi, I'm using MAX FCollada exporter to get meshes.
    When I export some objects, they have different count for VERTEX and TEXCOORD.
    In the code 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 texcoord)
    texcoord count will be the same or smaller than vertex count.
    In which point am I wrong?


    I appreciate in advance.


    Code :
    <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"/>
     
     
    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>

  2. #2
    Senior Member
    Join Date
    Jul 2004
    Location
    Santa Clara
    Posts
    356
    probably some texcoord are shared
    the

    element is the indirection into the VERTEX and TEXCOORD. it would be an error only if it would address outside of TEXCOORD array size.

  3. #3
    Junior Member
    Join Date
    Apr 2006
    Posts
    14

    Re: why TEXCOORD and VERTEX counts are different?

    I've got a question similar to that in the topic. I've noticed, when some geometry has multiple smoothing groups, the number of normals is greater than vertex count because some vertices can have more than one normal assigned because they can belong to two different smoothing groups so it makes sense and I'm ok with that. My problem is that I use data from DAE files in my DirectX application so to render an object I can't have vertex structure with two different normals. So far I was solving this with expanding the vertices array by creating new ones with the other normal positions each for the smooth group it belongs to. I'm thinking about other solution but haven't figured out anything interesting yet... Maybe someone could give me a hint?

  4. #4
    Member
    Join Date
    Feb 2005
    Location
    San Jose, CA
    Posts
    63

    Re: why TEXCOORD and VERTEX counts are different?

    It is possible to have the numbers of normals greater or less than the number of vertex.
    In your case where # of normals are > than # of vertex, you are right that some vertices have more than one normal since you can find more than one polygons using that same vertex but with different normals.

    You can use a deindexer conditioner to deindex your dae document. It will reorganize your mesh's data like vertices, normals, texcoords, and polygons indice. The new float_arrays are already to sent to OpenGL api like
    glVertexPointer()
    glNormalPointer()
    glTexCoordPointer()
    and glDrawArrays()

    I am not sure if Direct X have something similar, hope this will help you.

    Herbert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •