elenorcoli opened this issue on Jul 20, 2006 · 5 posts
elenorcoli posted Thu, 20 July 2006 at 4:27 PM
ok i made a simple 6 point box and got this info:
mtllib ./box2.mtl
g
v -35.7933578491 -5.9040594101 -0.0000002581
v 4.7970476151 -5.9040594101 -0.0000002581
v -35.7933578491 36.1623611450 0.0000015807
v 4.7970476151 36.1623611450 0.0000015807
v -35.7933578491 -5.9040575027 -39.8523979187
v 4.7970476151 -5.9040575027 -39.8523979187
v -35.7933578491 36.1623649597 -39.8523979187
v 4.7970476151 36.1623649597 -39.8523979187
g Box01
f 1 2 4 3
f 5 7 8 6
f 1 5 6 2
f 2 6 8 4
f 4 8 7 3
f 3 7 5 1
g
i understand the v is vertex and the f shows the lines between vertices. (by the way the line numbering in the crimson editor is a great way to track vertex number.)
but here's some other sample lines:
vt 0.36695 0.499049
vt 0.366495 0.503613
vt 0.366081 0.507879
....
vn -0.464828 -0.0285485 0.884941
vn -0.470744 -0.0381977 0.881442
vn -0.434739 0.0687812 0.897926
....
f 4680/2431/4680 2666/2427/2666 3087/816/3087 389/2432/389
f 3091/820/3091 3090/2433/3090 4680/2431/4680 389/2432/389
f 4680/2431/4680 3090/2433/3090 23760/14466/23760 23750/14462/23750
this info from a vic 3 head exported. i tink the vt must be morphs? but how would you know which vertex the morph is associated with? and what is that wierd face info about? it looks like it is describing the location in space of the vertices that connect...but the first and last digit of each set of 3 is identical> so that can't be it....anyone?
gracias
Stegy posted Thu, 20 July 2006 at 4:55 PM
I believe the vt, vn, & f lines have to do with uv mapping.
Example: a very simple plane before taking into a UV Mapping program:
g plane
v 0 0 0
v 10 0 0
v 0 10 0
v 10 10 0
vt 0 0
vt 1 0
vt 0 1
vt 1 1
vn 0 0 1
vn 0 0 1
vn 0 0 1
vn 0 0 1
f 1/1/1 2/2/2 4/4/4 3/3/3
After UV-mapping and changing it to a spherical mapping:
v 0.00000000 0.00000000 0.00000000
v 10.00000000 0.00000000 0.00000000
v 0.00000000 10.00000000 0.00000000
v 10.00000000 10.00000000 0.00000000
vt 0.02500000 0.02500000
vt 0.97500002 0.02500000
vt 0.97500002 0.97500002
vt 0.02500000 0.97500002
vn 0.00000000 0.00000000 1.00000000
vn 0.00000000 0.00000000 1.00000000
vn 0.00000000 0.00000000 1.00000000
vn 0.00000000 0.00000000 1.00000000
g plane
f 1/1/1 2/2/2 4/3/4 3/4/3
PhilC posted Thu, 20 July 2006 at 5:15 PM
Have a look at this page http://www.royriggs.com/poser.html
Scroll down to "OBJ File Format" http://www.royriggs.com/obj.html
Probably the best written explanation I have seen.
kuroyume0161 posted Thu, 20 July 2006 at 6:11 PM
v = vertex
vt = texture vertex (UV)
vn = normal of vertex
f = facet (polygon)
fo = facet also
l = line (can also represent spline)
g = group (sets the group for the facets that follow)
usemtl = material (sets the material group for the facets that follow)
mtllib = references a corresponding .mtl file that contains basic material settings for each material group
f is followed by up to three references: v/vt/vn for each vertex of the polygon.
Think, I pulled that from memory (though I double checked the order of the vertex types for 'f'). :)
Robert
ETA: Go here for a PDF which is probably the most definitive format specification for Wavefront OBJ around: http://www.wotsit.org/search.asp?page=2&s=3d
C makes it easy to shoot yourself in the
foot. C++ makes it harder, but when you do, you blow your whole leg
off.
-- Bjarne
Stroustrup
Contact Me | Kuroyume's DevelopmentZone
elenorcoli posted Thu, 20 July 2006 at 6:20 PM
wow thanks very thorough guys.
i like your tag robert.
gracias