Issue
I am loading the Node[]
object with the InteractiveMesh X3DModelImporter like so
Node[] model = importer.getImport();
Map<String, PhongMaterial> mapTexs = importer.getNamedMaterials();
but I fail on how to apply the PhongMaterials to the retrieved object since it is a Node array and there is no setMaterial
for Node/Group. I'm also curious on how to handle more than one material. Right now I just imported a green 2x2x0.5 box from Blender, but what about more complicated models?
I can't find any information in the API documentation either unfortunately.
Solution
This turned out to be a Blender related problem, rather than JavaFX/InteractiveMesh. I found that using the x3d files from the InteractiveMesh website worked flawlessly (the material is implicitly applied to the model). Apparently, Blender fails to export the applied material when exporting as x3d. When using .obj and the corresponding importer, the material showed up!
Answered By - samox