Sign in to follow this  
Stoo

Vertex lists and poor results

Recommended Posts

Hiya. I have recently begun exploring the world of 3D graphics and began pondering the ways of transferring model files for my applications. I began by downloading a free "office-chair" model for Blender, and exported it as .obj -file. Internally the file seems simple enough, a few informative header lines and a whole horde of vertexes. # Blender3D v245 OBJ File: office_chair.blend # www.blender3d.org v -0.703327 -2.860012 0.191537 v -0.516006 -2.860012 0.003550 v -0.081397 -2.746372 0.436619 .... And so on. I programmed a simple Class for opening and loading all the vertex data into a huge array of Vertex objects. The thing works well, and Everything works out well, until the actual rendering starts... http://img413.imageshack.us/img413/1512/lolgn9.jpg My program and I don't actually share a common vision of the chair, which brings us to the heart of my dillemma. I assumed that the vertexes in .obj -file are all describing triangle primitives and are located neatly so, that by just plotting them one after another everything would go on nicely. Apparently I was horribly wrong. How on earth am I supposed know which vertexes make triangles and which ones make quads? What if there are polygons? The .obj -file provides absolutely no clues on that matter. At the moment I am only trying to squeeze through the basic geometry. Normals, texture mapping or surfaces are not the focus here, so I am purposefully igoring those for now. Im sure someone else has already solved this one...

Share this post


Link to post
Share on other sites
Quote:
Original post by Stoo
How on earth am I supposed know which vertexes make triangles and which ones make quads? What if there are polygons? The .obj -file provides absolutely no clues on that matter.


Do a google search for "obj file-format".

Share this post


Link to post
Share on other sites
I really should have googled first...

The connection between vertexes, their numbers and faces is something I should have known.

Thanks for help guys, this has cleared a lot of confusion.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this