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

2

6

I wanted to use .obj format, but I noticed that it doesn't have representation for the type of material, i.e. opaque, transparent, reflective. Is there a common file format that includes that information as well, or should I just take the known .obj format and change it so that it'll include that info?

Briggs answered 6/12, 2010 at 8:37 Comment(0)
N
1

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

Nutlet answered 6/12, 2010 at 21:11 Comment(0)
L
1

.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
Lemur answered 1/1, 2011 at 14:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.