PDA

View Full Version : .obj file format



sandraider
02-25-2011, 06:26 PM
I'm reading the wikipedia article on the file format Wiki article (http://en.wikipedia.org/wiki/Wavefront_.obj_file). I'm not really sure how to render a face definition (lines starting in "f"), an example would be (f 1 2 3 4). there are 4 vertices, how would I render this example?

mobeen
02-25-2011, 08:17 PM
1 2 3 4 are the indices of the face. THe .obj file dumps the vertices first and then the faces. The only thing u need to be careful with is that these face indices start from 1 and so when indexing in the vertex buffer you need to subtract 1 from the face index.
Check this (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=291434) thread

sandraider
02-26-2011, 05:03 AM
thanks for the help mobeen, I have it working now.