Reputation: 619
I simply cannot get the textures to load for my basic 3d models. The model appears but is only in grey.
I am using this model: https://www.turbosquid.com/3d-models/free-max-mode-hammer/384372
I am using the following code.
<a-asset-item id="hammer-obj" src="hammer.obj"></a-asset-item>
<a-asset-item id="hammer-mtl" src="hammer.mtl"></a-asset-item>
<a-entity
obj-model="obj: #hammer-obj; mtl: #hammer-mtl"
scale="1 1 1"
position="0.05 1 -1.90">
My MTL file currently looks like:
newmtl head
Ka 0 0 0
Kd 0 0 0
Ks 0.637 0.637 0.637
illum 2
Ns 2
map_Kd hammer.jpg
map_bump hammer.jpg
bump hammer.jpg
newmtl grip
Ka 0 0 0
Kd 0 0 0
Ks 1 1 1
illum 2
Ns 2
map_Kd hammer.jpg
map_bump hammer.jpg
bump hammer.jpg
I have converted the TIFF file into a jpg as well and that didnt work. I initially had all links to hammer.TIF but I tried JPEG.
Could anyone give me any insight as to what is happening?
Thanks.
Upvotes: 1
Views: 844
Reputation: 14655
If You want to get results 'as expected', my recommendation is the three.json and .glTF formats.
Apparently they are well implemented, and don't cause unexpected behaviour like obj's with mtl's, or sadly fbx's.
In my opinion You should use some blender glTF( 1 or 2 ) exporter, and change the 3D hammer model format, or You could use clara.io, to export it to the three.js json format.
Don McCurdy of the a-frame team recommended using the glTF and json format here.
In fact there is some valuable information there, like how using the material component to texture the .obj with a .jpg works randomly.
You can also find more information on model troubleshooting here.
Upvotes: 1