как применить разные изображения для каждого лица в coin3d или openInventor?
Я создаю 6 лиц с помощью SoIndexedFaceSet и хочу применить разные изображения для каждого лица с помощью SoTexture3, но это не работает. Не могли бы вы дать мне несколько советов о том, как применять разные изображения или текстуры для каждого лица в Coin3d или OpenIventor? Я не знаю, неправильный ли это мой метод или я потерял какое-то другое ключевое свойство? Большое спасибо. И вот мой код
//
SoSeparator* root = new SoSeparator;
root->ref();
//
SoTransform* pTransfrom = new SoTransform;
pTransfrom->translation.setValue(0, 0, 0);
root->addChild(pTransfrom);
SoMaterialBinding* faceBind = new SoMaterialBinding;
faceBind->value = SoMaterialBinding::PER_PART;
root->addChild(faceBind);
//
SoTexture3* texture = new SoTexture3;
texture->filenames.set1Value(0, SbString("D:/wrapper/TCom_Wall_Stone3_2x2_1K_albedo.tif"));
texture->filenames.set1Value(1, SbString("D:/wrapper/Com_Wall_Stone3_2x2_1K_ao.tif"));
texture->filenames.set1Value(2, SbString("D:/wrapper/TCom_Wall_Stone3_2x2_1K_height.tif"));
texture->filenames.set1Value(3, SbString("D:/wrapper/TCom_Wall_Stone3_2x2_1K_normal.tif"));
texture->filenames.set1Value(4, SbString("D:/wrapper/4.jpg"));
texture->filenames.set1Value(5, SbString("D:/wrapper/5.jpg"));
root->addChild(texture);
//
SoCoordinate3* coordinates = new SoCoordinate3;
//front
coordinates->point.set1Value(0, 0, 0, 0);
coordinates->point.set1Value(1, step, 0, 0);
coordinates->point.set1Value(2, step, 0, step);
coordinates->point.set1Value(3, 0, 0, step);
//back
coordinates->point.set1Value(4, step, step, 0);
coordinates->point.set1Value(5, 0, step, 0);
coordinates->point.set1Value(6, 0, step, step);
coordinates->point.set1Value(7, step, step, step);
//
root->addChild(coordinates);
//
SoIndexedFaceSet* faceSet = new SoIndexedFaceSet;
//front
faceSet->coordIndex.set1Value(0, 0);
faceSet->coordIndex.set1Value(1, 1);
faceSet->coordIndex.set1Value(2, 2);
faceSet->coordIndex.set1Value(3, 3);
faceSet->coordIndex.set1Value(4, -1);
//back
faceSet->coordIndex.set1Value(5, 4);
faceSet->coordIndex.set1Value(6, 5);
faceSet->coordIndex.set1Value(7, 6);
faceSet->coordIndex.set1Value(8, 7);
faceSet->coordIndex.set1Value(9, -1);
//left
faceSet->coordIndex.set1Value(10, 5);
faceSet->coordIndex.set1Value(11, 0);
faceSet->coordIndex.set1Value(12, 3);
faceSet->coordIndex.set1Value(13, 6);
faceSet->coordIndex.set1Value(14, -1);
//right
faceSet->coordIndex.set1Value(15, 1);
faceSet->coordIndex.set1Value(16, 4);
faceSet->coordIndex.set1Value(17, 7);
faceSet->coordIndex.set1Value(18, 2);
faceSet->coordIndex.set1Value(19, -1);
//top
faceSet->coordIndex.set1Value(20, 3);
faceSet->coordIndex.set1Value(21, 2);
faceSet->coordIndex.set1Value(22, 7);
faceSet->coordIndex.set1Value(23, 6);
faceSet->coordIndex.set1Value(24, -1);
//bottom
faceSet->coordIndex.set1Value(25, 5);
faceSet->coordIndex.set1Value(26, 4);
faceSet->coordIndex.set1Value(27, 1);
faceSet->coordIndex.set1Value(28, 0);
faceSet->coordIndex.set1Value(29, -1);
root->addChild(faceSet);
//
setSceneGraph(root);```