# 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

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.

For an importer I think it’s a good idea to just ignore the count attribute.

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.