hy.
I have a mesh with 2 subset with 2 different material .
My importer start to import from the scene graph.
But when i get a node of the scenegraph i have an istance with the 2 material
now in the normal sequence i get the geometry
const domInstance_geometry_Array pGeomAry = m_CurrentNode->getInstance_geometry_array()//current node is the current node //selected by the traverse the scene graph.
//i use this for get the geometry isnstance.
xsAnyURI puriGeom = pGeomAry.get(0)->getUrl();
puriGeom.resolveElement();
In a multiple mesh subset i get the group of triangles that have the current node material group of vertex,but with 2 instance of 2 different materials how i resolve the triangle group that i must process?(I have 2 triangle group in this case ) and start reading the geometry of the corrispondent subset(triangle group)?
Your <bind_material> is trying to bind:
Materialaer with
Material_ferr with
The material group names in triangles happened to be the same as id of material. This is not neccessary required.
Here is a better example on how to resolve the material binding
thanks.
And in collda dom(that i use)there is a method for get the relative materials group triangle?
Now I get the group of triangle by a numeric index (0,1,2)in succession.
How i get the group by the specific material?
The material group is a xml attribue in your triangles element.
If you use the COLLADA DOM, then check the below code
domTriangles * triangles = mesh->getTriangles_array()[triangle_index];
daeString * material_group = triangles->getMaterial();
// lookup your binding table with key = material_group
// you'll get result material ID from the binding table
// That ID will be the material you use for that instance_geometry