Advertisement

Wavefront Format Question

Started by April 27, 2002 11:24 AM
3 comments, last by slashandburn 22 years, 10 months ago
Im trying to switch to a diffrent format, other then asc, so i think "Wavefront" format might be well but i am wondering what "vt" is? It is the texture alignment? #--------------- Box01 --------------- v -20.000000 -20.000000 -20.000000 v -20.000000 20.000000 -20.000000 v 20.000000 20.000000 -20.000000 v 20.000000 -20.000000 -20.000000 v -20.000000 -20.000000 20.000000 v 20.000000 -20.000000 20.000000 v 20.000000 20.000000 20.000000 v -20.000000 20.000000 20.000000 vt 0.746042 0.253957 vt 0.253957 0.253958 vt 0.253958 0.746043 vt 0.746043 0.746042 vt 0.607511 0.392489 vt 0.607511 0.607511 vt 0.392489 0.607511 vt 0.392489 0.392489 g Box01 f 1/1/ 2/2/ 3/3/ f 3/3/ 4/4/ 1/1/ f 5/5/ 6/6/ 7/7/ f 7/7/ 8/8/ 5/5/ f 1/1/ 4/4/ 6/6/ f 6/6/ 5/5/ 1/1/ f 4/4/ 3/3/ 7/7/ f 7/7/ 6/6/ 4/4/ f 3/3/ 2/2/ 8/8/ f 8/8/ 7/7/ 3/3/ f 2/2/ 1/1/ 5/5/ f 5/5/ 8/8/ 2/2/
probably
Advertisement
http://www.wotsit.org/search.asp?page=2&s=3d
v''s are vertices
vt''s are texture vertices
vn''s are normals

g is grouping information

f = face
fo = face-outline (non-filled polygon which is pretty much interchangable with f)

the numbers after an f or fo are the vertices (starting with 1, not 0) that make up the closed polygon.

if there are vn''s or vt''s that need to be referenced, /''s are used to make 3 vertex references for each point in the polygon. The order is v/vt/vn. If vn''s aren''t used, then the trailing / is just left there (like your example - "f #/#/ #/#/ #/#/"). If vt''s aren''t used, then it''d look like "f #//# #//# ...". If both vn''s and vt''s aren''t used, it''s simply "f # # #" without any reference to vn''s or vt''s and without any /''s.

s is smoothing group information (relates to how the normals are shared at common vertices -- only important if the normals aren''t provided. Since most converters seem to provide normals, it''s kinda unimportant.)

usemtl and usemap are material definition keywords.

there are other keywords for vertex coloring and polygon coloring (and even stuff to define rudimentary spline patches, if I recall) but I doubt most people need that stuff these days...

I have my obj loader working with texture mapping now, Thanks. My 3d fish look so much better now.

This topic is closed to new replies.

Advertisement