I'm attempting to display DRC files in a web browser because of the superior compression results compared to OBJ files. I have successfully rendered DRC files, but I am facing an issue with adding an MTL file. Each object I have includes both a DRC and an MTL file, and I want to load and render both in the browser.
Initially, I tried using the OBJLoader_MTLLoader_example from here, but it does not seem to work with DRACOLoader.
Next, I attempted the solution provided at this link. However, I encountered an error stating that the setMaterials function in MTLLoader.js is not defined, even though it actually is. Any assistance would be greatly appreciated.
<script
src="https://cdn.rawgit.com/mrdoob/three.js/dev/build/three.min.js">
</script>
<script src="DDSLoader.js"></script>
<script src="DRACOLoader.js"></script>
<script src="MTLLoader.js"></script>
<script src="geometry_helper.js"></script>
...
//MTL Loader
THREE.Loader.Handlers.add( /\.dds$/i, new THREE.DDSLoader() );
new THREE.MTLLoader()
.load( './bed.mtl', function ( materials ) {
materials.preload();
new THREE.DRACOLoader()
.setMaterials( materials )
} );
... scene.add(geometry, materials);
Link to entire file: This link
The desired output is a colored 3D object, but currently, it only appears in black. This suggests that only the geometry is visible, without any colors, materials, or textures applied.