您的位置:首页 > 其它

OBJ材质文件MTL格式分析

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

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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: