0

I need a basic material in my mesh.

I have this material in my MTL file:

newmtl window
Ns 0.000000
Ka 0.000000 0.000000 0.000000
Kd 0.888930 0.994660 0.000000
Ks 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 1

what attribute makes material to be "THREE Basic Material"?

Martin
  • 2,575
  • 6
  • 32
  • 53

1 Answers1

0

The given MTL file translates to

new THREE.MeshLambertMaterial( { color: new THREE.Color( 0.888930, 0.994660, 0 ) } );
gaitat
  • 12,449
  • 4
  • 52
  • 76
  • 1
    for it to be a phong material you would need to specify the `specular` term, the `shininess` term, etc. I am not quite sure what you mean. – gaitat May 04 '15 at 16:42
  • When i load *.obj mesh to scene, it uses a MTL library. Materials from MTL are loaded always as PhongMaterial. I need to create one of materials like BasicMaterial. I can only update MTL file, not hack js code. – Martin May 04 '15 at 16:47
  • 1
    if materials from MTL are always loaded as PhongMaterial there is nothing you can do in the .mtl file that will produce a BasicMaterial. But what you can do is after your object is loaded to go search for the specific PhongMaterial by name and change it to BasicMaterial. – gaitat May 04 '15 at 16:51
  • I need a material looking like lighted window, (white surface not affected by light), is there another way to do this in mtl file without editing a js code? – Martin May 04 '15 at 16:57
  • I dont know if materials are always loaded as Phong, that was a meaning of question. – Martin May 04 '15 at 16:58
  • 1
    The OBJMTLLoader() always loads materials as MeshLambertMaterial(). – gaitat May 04 '15 at 17:03
  • please correct your answer, in your comment is it right, in answer not. – Martin Jun 03 '15 at 06:25
  • 1
    **Clarification**. The OBJLoader uses the **Phong** material, not the **Lambert** as stated. Please [take a look at the source code -latest version, not the one you might have in your js libraries-](https://github.com/mrdoob/three.js/blob/6c7f000734f8579da37fb39e5c2e9e5e2dfb14f8/examples/js/loaders/OBJLoader.js#L699) – SntsDev Sep 16 '16 at 07:14
  • Maybe someone just forgot to add normals to obj. – zwcloud Feb 09 '18 at 02:35