Saturday, September 3, 2016

Define: Model File Format .. OBJ

Wikipedia describes:

Key: Model File Format; Text Version; Binary Version;

OBJ (or .OBJ) is a geometry definition file format first developed by Wavefront Technologies for its Advanced Visualizer animation package. The file format is open and has been adopted by other 3D graphics application vendors. For the most part it is a universally accepted format.The OBJ file format is a simple data-format that represents 3D geometry alone — namely, the position of each vertex, the UV position of each texture coordinate vertex, vertex normals, and the faces that make each polygon defined as a list of vertices, and texture vertices. Vertices are stored in a counter-clockwise order by default, making explicit declaration of face normals unnecessary. OBJ coordinates have no units, but OBJ files can contain scale information in a human readable comment line.
...

Basic Conception: Meshes, Faces, Surfaces...


Before we begin with loading a model, it would be a nice thing to abstract things related to 3D models and make them clear. The first and very basic term is vertex - your model will surely consist of several vertices (thank you, Captain Obvious ). If we connect 2 vertices, we'll get an edge. The CLOSED set of edges is called a face. The typical face type is triangle, consisting of 3 vertices and 3 edges - <0, 1>, <1, 2> <2, 0>. Closed is written with capital letters, because face cannot be just three points, that form a line strip for example. I guess that word face is derived somehow from facing - you can tell that face is facing a direction (calculate its normal), whereas line strip doesn't face anything. Finally, polygon is a set of faces, like quad is set of 2 triangle faces.

From these basic terms, we get into higher structures. Surface, or smoothing group is a set of polygons, that have the same smoothing technique and parameters. Great example why to separate some polygons into smoothing groups is cylinder. There is a need to create 3 smoothing groups - top, bottom and sides - like this:
We can also create several groups of the polygons, that represents sub-objects of model. Like when you have a human model, groups defined can be left leg, right leg, left arm, right arm, head and so on. This is good for creating animations for example. And finally, all the groups together form a mesh, and it's basically whole 3D model. I hope that's clear.




No comments:

Post a Comment