virocore
virocore copied to clipboard
Load mtl file manually from firebase
- OS: Windows
- Version: ViroCore version
- Device(s): samsung a5
Description
I have uploaded the mtl file and obj file separately to firebase database. When I loaded the 3d obj model, it cannot read mtl file. May i know is there any way to load mtl file to 3d obj model programmatically?
Hi @HLneoh , Thanks for reaching out. From our Object3D,
To load an OBJ with an associated MTL file, the MTL file and all of its associated textures must placed in the same directory as the OBJ file. They will then be automatically retrieved and applied.
Currently there is no way to manually load the mtl file to the 3d obj model. But you can manually set the material textures, colors, etc. Example here -> https://virocore.viromedia.com/v1.11.0/docs/3d-scene-lighting#materials . If manually constructing the materials object is too cumbersome, I'd recommend trying to pre-download the mtl & obj files from firebase to local media in the same directory, before trying to render the 3d object on to the scene.