I want to write a parser for Blender's .obj file. The file format seems self explanatory, but also it seems to be missing some data. For example, a simple cube (the default Blender cube) has 8 lines of vertexes, but I was expecting to see 36 lines (12 triangles to form a cube).
I think the confusion, at lease for me, stems from the way cubes are created in direct3d. Direct3d requires 36 vertexes to form a cube. So I am thinking that I need to infer the other 28 vertexes. This type of guessing could cause issues later on when trying to parse vertexes for more complex shapes. So, I thought if I could find the official specs on the file format it might provide me with some insight into how to interpret the data.
It seems that someone else had asked the same question before: How to get proper number of vertices in OBJ file from DCC tools such as Blender for use in OpenGL ES? but it didn't have any useful information for me.
Just install the software OBJ Viewer To begin viewing 3D files, simply do the following Install the extension OBJ Viewer Click on the extension icon Choose the 3D file you wish to open Begin viewing your 3D files online today! This 3D viewer works for both STL and OBJ file formats.
An OBJ file (. obj) contains information about the geometry of 3D objects. The files are used for exchanging information, CAD, and 3D printing. OBJ files can support unlimited colors, and one file can define multiple objects.
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.
Wavefront .obj file. 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.
The so-called "Alias/Wavefront OBJ" file format has the following features: It is a simple, portable, ASCII/Text based format. It is widely supported by 3D geometry authoring tools (3ds MAX, Maya, Rhino, SketchUp, Blender, etc.). It supports per-facet material attribution.
2 file types use the .obj file extension. What is an OBJ file? An OBJ file is a standard 3D image format that can be exported and opened by various 3D image editing programs. It contains a three-dimensional object, including 3D coordinates, texture maps, polygonal faces, and other object information.
However, the simple format structure may also lead to huge OBJ file sizes if they store large and complex 3D objects. You may encounter an OBJ file in various ways, such as when modifying 3D objects in a video game, creating visual effects for a film, or designing a 3D mockup of a real-life object or building.
OBJ Spec
MTL Spec (you'll probably want this too at some point)
FYI OBJ is in no way related to Blender, it's just a common file format for simple models.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With