private void groupObjectComponents(Object3D obj, List<Vertex> vertices, List<int> indices, List<Color3f> colors, int faceStatus1, int faceStatus2)
{
Face face;
//for each face..
for (int i = 0; i < obj.getNumFaces(); i++)
{
face = obj.getFace(i);
//if the face status fits with the desired status...
if (face.getStatus() == faceStatus1 || face.getStatus() == faceStatus2)
{
//adds the face elements into the arrays
Vertex[] faceVerts = { face.v1, face.v2, face.v3 };
for (int j = 0; j < faceVerts.Length; j++)
{
if (vertices.Contains(faceVerts[j]))
{
indices.Add(vertices.IndexOf(faceVerts[j]));
}
else
{
indices.Add(vertices.Count);
vertices.Add(faceVerts[j]);
colors.Add(faceVerts[j].getColor());
}
}
}
}
}