# Implementing models with many vertices

``````				<vertices id="zombie-vertices-0">
<input semantic="POSITION" source="#zombie-positions-0"/>
<input semantic="NORMAL" source="#zombie-normals-0"/>
<input semantic="TEXCORD" source="#zombie-uv-0"/>
</vertices>
<vertices id="zombie-vertices-1">
<input semantic="POSITION" source="#zombie-positions-1"/>
<input semantic="NORMAL" source="#zombie-normals-1"/>
<input semantic="TEXCORD" source="#zombie-uv-1"/>
</vertices>
<vertices id="zombie-vertices-2">
<input semantic="POSITION" source="#zombie-positions-2"/>
<input semantic="NORMAL" source="#zombie-normals-2"/>
<input semantic="TEXCORD" source="#zombie-uv-2"/>
</vertices>
<triangles count="4338" material="mtl-0">
<input offset="0" semantic="VERTEX" source="#zombie-vertices-0" set="0"/>

757 756 765 ...</p>
</triangles>
<triangles count="2811" material="mtl-1">
<input offset="0" semantic="VERTEX" source="#zombie-vertices-1" set="0"/>

322 377 837 4...</p>
</triangles>
<triangles count="2259" material="mtl-2">
<input offset="0" semantic="VERTEX" source="#zombie-vertices-2" set="0"/>

670 669 668 ...</p>
</triangles>
``````

I’ve gathered from the coherency test that only one <vertices> declared, but I have 3 sets of geometries. What is the correct way to reference the vertices with the triangles? Sets?

Because the triangles don’t share the same vertices does this mean I have to create as many <geometry> as groups of vertices?

I’m not a specialist but I’ve noticed some things. Maybe it will help you.
First of all refer to COLLADA Schema (ver 1.5 the newest), it says that mesh can contain only one <vertices… element per mesh so you can’t put more than one in it. I think you should create a new geometry for each group of vertices that you want to define as a different object. I think you won’t be able to do that with multiple triangles because it’s rather used for assigning different materials for different parts of mesh - paint some with one and some with the other. If you use primitives (triangles, polys etc.) the way you put all together is:

``````
<vertices id="Gallardo-mesh-vertices">
[b]<input semantic="POSITION" source="#Gallardo-mesh-positions"/>[/b]
</vertices>
<triangles material="Material__25" count="5412">
[b]<input semantic="VERTEX" source="#Gallardo-mesh-vertices" offset="0"/>[/b]
<input semantic="NORMAL" source="#Gallardo-mesh-normals" offset="1"/>
<input semantic="TEXCOORD" source="#Gallardo-mesh-map-channel1" offset="2" set="1"/>

6955...</p>
</triangles>
<triangles material="Material__26" count="2080">
[b]<input semantic="VERTEX" source="#Gallardo-mesh-vertices" offset="0"/>[/b]
<input semantic="NORMAL" source="#Gallardo-mesh-normals" offset="1"/>
<input semantic="TEXCOORD" source="#Gallardo-mesh-map-channel1" offset="2" set="1"/>

0581...14831</p>

``````
• store all vertices positions of chosen group in one source element
• in each triangle (if you have multi materials applied) refer to those positions by defining <input… (shared) element with “VERTEX” semantic which leads you to <vertices… and then you get another <vertices…<input… (unshared) with “POSTION” semantics and resolve source attribute… It’s little confusing why we need the <vertices… for, but it was discussed somewhere on this forum…

I hope i helped.

I have 3 sets of positions but in your example you have 1. Did you merge them into one array? I’d rather not have to write up the code to transform anything. I think creating a new mesh is the right thing to do for me… which you’ve answered for me. Thanks matey

Can <geometry> have more than one <mesh>?
Or is the best way to really implement this is to merge all the positions and offset the other values?

Yes

If a geometry has more than one mesh, it would increase the number of mesh objects and subsequently the memory consumption.

We have tried this out for better (filling up) color rendering of the meshes.

You could go for 1 mesh per material within a geometry.

Hope this helps.

So i’ll merge the positions and add the offsets to the other arrays.

<geometry…> element can contain only one <mesh> element! see 1.5 schema specifications.

Thanks mate.

No, a <geometry> can have one <mesh>. What you are describing is either primitives (e.g. <triangles>) or is invalid.