3D模型-OBJ材质文件 MTL格式分析

OBJ文件不包含面的颜色定义信息,不过可以引用材质库,材质库信息储存在一个后缀是".mtl"的独立文件中。关键字"mtllib"即材质库的意思。 材质库中包含材质的漫射(diffuse),环境(ambient),光泽(specular)的RGB(红绿蓝)的定义值,以及反射(specularity),折射(refraction),透明度(transparency)等其它特征。  "usemtl"指定了材质之后,以后的面都是使用这一材质,直到遇到下一个"usemtl"来指定新的材质。

Ka  r g b defines the ambient color of the material to be (r,g,b). The default is (0.2,0.2,0.2); Kd  r g b defines the diffuse color of the material to be (r,g,b). The default is (0.8,0.8,0.8); Ks  r g b defines 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  alpha defines 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  alpha defines 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  s defines the shininess of the material to be s. The default is 0.0; illum  n denotes 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  filename names a file containing a texture map, which should just be an ASCII dump of RGB values;

你可能感兴趣的:(openGL,mtl,obj,opengl,图形)