how to set the material of multipatch when create multipatch

665
0
01-11-2021 07:03 PM
梅扬
by
New Contributor

 

int demsion = 2;
int numMaterials = 8;
int numMaterialslen = 16;

MultiPatchShapeBuffer testGeometry;
testGeometry.Setup(shapeTypes, numParts, numPts, numTextures, demsion, numMaterials, numMaterialslen);
testGeometry.GetPartDescriptors(descs);
for (size_t m = 0; m < numParts; m++)
{
//descs[m] = ns[m];
descs[m] =6;
}
int* pt;
testGeometry.GetParts(pt);
GeometryType geometryDeff=geometryMultiPatch;
testGeometry.GetGeometryType(geometryDeff);
testGeometry.GetNumParts(numParts);
testGeometry.GetNumPoints(numPts);
float* normals;
testGeometry.GetNormals(normals);
int* id ;
testGeometry.GetIDs(id);

int textureDimension;
int *textureParts;
float *texturesCoords;
bool xe= testGeometry.HasTextures(shapeTypes);
hr=testGeometry.GetTextures(numTextures, textureDimension, textureParts, texturesCoords);

int nummaterialww ;
int compressionww ;
int *partww = NULL;
byte *materialww = NULL;
fgdbError error;
error = testGeometry.GetMaterials(nummaterialww, compressionww, *&partww, *&materialww);
bool xx = testGeometry.HasMaterials(shapeTypes);

 

 

I had set the num of texture and material through the function set()of  multipatch,but when i try to get the pointer to the materials array and texture coordinates...,it return null 。I really hope you can help me solve this problem,i need your help!

 

 

0 Kudos
0 Replies