I got a big 3d model(.glb/.babylon) which contained around 100 nodes and 100 relative materials. I can check the whole model structure on sandbox scene explorer. Actually I want to realize 3 things as below
- Acquire the original material/texture rendering.
- every submesh can be clipplaned.
- every submesh can be picked/selected.
But seems calling ImportMesh without further process cannot make it happen. So I try the following original specified material. It works for 1) but not for 2) and 3).(materials[i] keep all 100 materials name I got from sandbox scene explorer)
SceneLoader.ImportMesh("", "/models/", "abc.babylon", scene, (newMeshes) => {
for (let i = 0; i < newMeshes.length; i++) {
newMeshes[i].material = scene.getMaterialByName(materials[i]);
}
}
Then I also try the following code snippet to apply default/Standard Material. And now it works for 2) and 3) but not for 1). Meaning that the whole mesh not looks beautiful/real as I saw in sandbox. Something like white model.
SceneLoader.ImportMesh("", "/models/", "abc.babylon", scene, (newMeshes) => {
for (let i = 0; i < newMeshes.length; i++) {
newMeshes[i].material = new StandardMaterial("derrickMaterial", scene);
}
}
Would you please help me for a way out? Thanks