Results 1 to 4 of 4

Thread: Count attribute in geometry elements

  1. #1
    Junior Member
    Join Date
    Apr 2008
    Posts
    7

    Count attribute in geometry elements

    Hi,

    The following is taken from the Collada spec pg 4-118.

    Here is an example of a <tristrips> element that describes two triangles. There are two <source> elements that contain the position and normal data, according to the <input> element semantics. The

    element index values indicate the order in which the input values are used:

    <mesh>
    <source id="position"/>
    <source id="normals"/>
    <vertices id="verts">
    <input semantic="POSITION" source="#position"/>
    </vertices>
    <tristrips count="1" material="#Bricks">
    <input semantic="VERTEX" source="#verts" offset="0"/>
    <input semantic="NORMAL" source="#normals" offset="1"/>


    0 0 1 3 2 1 3 2</p>
    </tristrips>
    </mesh>
    I am not clear about the count attribute in the tristrips element. The text says that the code describes 2 triangles. However, count = 1. What exactly does the count attribute refer to: the number of

    elements or the number of triangles indexed by the

    element?

    The same question applies to the linestrips, polygons and trifans elements.

    Thanks

    Mark

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    If the primitive supports multiple

    elements then the count refers to the number of

    elements, otherwise the count refers to the number of atoms (triangles, etc) in the primitive.

    triangles: number of triangles
    polylist: number of polygons
    lines: number of lines
    trifans: number of

    elements
    tristrips: number of

    elements
    polygons: number of

    elements
    linestrips: number of

    elements

    This is confusing. Frankly I don't think the count attribute should even be present. It doesn't solve anything.

  3. #3
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    For an importer I think it's a good idea to just ignore the count attribute.

  4. #4
    Junior Member
    Join Date
    Apr 2008
    Posts
    7
    triangles: number of triangles
    polylist: number of polygons
    lines: number of lines
    trifans: number of

    elements
    tristrips: number of

    elements
    polygons: number of

    elements
    linestrips: number of

    elements

    This is confusing. Frankly I don't think the count attribute should even be present. It doesn't solve anything.
    Thanks for the information. It makes things clearer. I agree that the count attribute can be done without.

Posting Permissions

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