threejs-es6-webpack-starter
threejs-es6-webpack-starter copied to clipboard
How can you use MTLLoader & OBJLoader?
Trying to use these packages but it seems like I can't import the .mat and .obj. Is this a webpack issue where I need another loader?
Three.js has its own loader for OBJ files, but I haven't (yet) used it in this repo.
Have a look at these links:
First of all make sure you configure a new webpack rule, something like`
//MTL
{
test: /\.(mtl)$/,
use:
[
{
loader: 'file-loader',
options:
{
outputPath: 'assets/models/'
}
}
]
}
Beyond that, webpack will not get the textures referenced in your material file, so I believe a different loader is needed. No clue how to do that, I have only been able to load the .obj and then I get 404s from the textures.