What types of geometry definition file format is best used with ray tracing to include the type of material

泄露秘密 提交于 2019-12-05 06:00:18

you might want to check mtl-files. Haven't (yet) used it myself though ;)

http://people.sc.fsu.edu/~jburkardt/data/mtl/mtl.html

and

http://people.sc.fsu.edu/~jburkardt/data/obj/obj.html

Cheers

.obj can referance .mtl files, which can hold opaque, transparent, reflective, colours, refractive index, and more.

The file is referanced by putting following line at the top:

mtllib *fileName*.mtl

Then in the faces section of the .obj file you can add these:

usemtl *materialName*

Finaly in the MTL file you will want a few sections like this:

# declaration of new material
newmtl *materialName*
# shininess
Ns 0.000000
# ambient colour
Ka 0.200000 0.200000 0.200000
# diffuse colour
Kd 0.800000 0.800000 0.800000
# specular colour
Ks 1.000000 1.000000 1.000000
# refractive index
Ni 1.000000
# transparency
d 1.000000
# illumination model 
illum 2
# texture
map_Kd texName.png
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!