Skip to content Skip to sidebar Skip to footer

Texture Not Being Rendered By Objmtlloader

I have a 3d model with texture that comes from Blender in OBJ/MTL/JPG format. But I cannot get this to render correctly with Three,js. The viewer code is identical to the example

Solution 1:

You need to understand what the parameters in your MTL file represent. Your diffuse reflectance and ambient reflectance are black -- not good. Change them to something reasonable, like so:

Kd 1.000 1.000 1.000     # white
Ka 1.000 1.000 1.000     # white

Or modify your loader callback function like so:

node.material.color.setRGB( 1, 1, 1 );
node.material.ambient.setRGB( 1, 1, 1 ); // no longer required (see Note)

Note: The ambient property of material has been removed from three.js, so you now only need to set the color.

three.js r.71

Post a Comment for "Texture Not Being Rendered By Objmtlloader"