MatCreator opened this issue on Jun 24, 2011 · 9 posts
mairaj posted Thu, 28 July 2011 at 11:55 PM
Attached Link: 3D Modeling
**Hi Guys Mairaj here sharing some about .Mtl files**MTL is a data directory which contains examples of MTL files. An MTL file is an auxilliary file containing definitions of materials that may be accessed by an OBJ file. The OBJ file must specify the name of the MTL file by a command such as
mltlib <em>file_name</em>
It is presumed that the MTL file names and defines various materials, such as, perhaps, "shinyred" or "iron". Then, within the OBJ file, the command usemtl shinyred
indicates that all subsequence faces should be rendered with this material, until a new material is invoked.
An MTL file contains a sequence of definitions of materials. Each definition begins with a newmtl statement that defines the name of the material, followed by lines specifying particular properties.
newmtl shinyred
Ka 0.1986 0.0000 0.0000
Kd 0.5922 0.0166 0.0000
Ks 0.5974 0.2084 0.2084
illum 2
Ns 100.2237
Comments begin with a '#' character in column 1. Blank lines may be inserted for clarity. Otherwise, the file consists of a sequence of newmtl statements, followed by a definition of various properties for that material.
The quantities that may be defined for a material include:
Ka r g bdefines the ambient color of the material to be (r,g,b). The default is (0.2,0.2,0.2);Kd r g bdefines the diffuse color of the material to be (r,g,b). The default is (0.8,0.8,0.8);Ks r g bdefines the specular color of the material to be (r,g,b). This color shows up in highlights. The default is (1.0,1.0,1.0);d alphadefines the transparency of the material to be alpha. The default is 1.0 (not transparent at all) Some formats use Tr instead of d;Tr alphadefines the transparency of the material to be alpha. The default is 1.0 (not transparent at all). Some formats use d instead of Tr;Ns sdefines the shininess of the material to be s. The default is 0.0;illum ndenotes the illumination model used by the material. illum = 1 indicates a flat material with no specular highlights, so the value of Ks is not used. illum = 2 denotes the presence of specular highlights, and so a specification for Ks is required.map_Ka filenamenames a file containing a texture map, which should just be an ASCII dump of RGB values;