Skip to content

Commit a2b3d8c

Browse files
committed
fix objmtl.js
1 parent 515fe8b commit a2b3d8c

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

objmtl.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,11 @@ ObjData.prototype._getMaterial=function(mesh){
9090
MtlData.prototype._resolveTextures=function(){
9191
for(var i=0;i<this.list.length;i++){
9292
var mtl=this.list[i].data;
93-
if(mtl.textureName){
93+
if(mtl.textureMap){
9494
var resolvedName=ObjData._resolvePath(
95-
this.url,mtl.textureName);
96-
//console.log(resolvedName)
97-
this.list[i].data=new Texture(resolvedName)
98-
.setParams(mtl);
95+
this.url,mtl.textureMap.name);
96+
this.list[i].data=mtl.copy()
97+
.setParams({"textureMap":resolvedName});
9998
}
10099
}
101100
}
@@ -159,12 +158,8 @@ MtlData._getMaterial=function(mtl){
159158
var ret=new Material(ambient,diffuse,specular,shininess,
160159
emission);
161160
if(textureName){
162-
ret=new TexturedMaterial(textureName).setParams({
163-
"ambient":ambient,
164-
"diffuse":diffuse,
165-
"specular":specular,
166-
"shininess":shininess,
167-
"emission":emission
161+
ret=ret.setParams({
162+
"textureMap":textureName
168163
})
169164
}
170165
return ret;

0 commit comments

Comments
 (0)