Wavefront OBJ Reader
| Wavefront OBJ | |
| File Extension | OBJ, MTL |
| Supported Versions | Any |
| Platforms | |
| Tessellation | Supported |
| B-rep | N/A |
| PMI | N/A |
Wavefront OBJ is an open file format created by Wavefront Technologies in the early 1990s as part of their Advanced Visualizer software. This format is widely used in 3D graphics and has been adopted by various other applications due to its open nature and compatibility with multiple software tools.
Wavefront OBJ support in HOOPS Exchange allows you to import data for visualization, rendering, and downstream workflows.
- Tessellation: Mesh or polygonal geometry is imported directly.
- B-rep: Not supported by this format - HOOPS Exchange treats it as tessellation only.
The most common file extensions of OBJ files are:
- .OBJ
- .MTL for material data
How to Import From OBJ
If you are new to reading models with HOOPS Exchange, see the basic load workflow </guide/basic_operations/load_model>` section of the Programming Guide.
To load an OBJ file, use A3DAsmModelFileLoadFromFile().
Below, the A3DParamsLoadData structure is used to customize the loading behavior. See our API reference manual for more information about this important data type.
A3DAsmModelFile* pModelFile = 0;
A3DRWParamsLoadData sReadParam;
A3D_INITIALIZE_DATA(A3DRWParamsLoadData, sReadParam);
sReadParam.m_sGeneral.m_bReadSolids = true;
// ... set other A3DRWParamsLoadData fields as necessary
A3DAsmModelFileLoadFromFile("path/to/file.obj", &sReadParam, &pModelFile);
See Simple Load and Export for general information about loading model files.
B-rep
This concept is not supported by OBJ.
PMI
This concept is not supported by OBJ.
Assembly
This concept is not supported by OBJ. However, many Wavefront OBJ files may contain multiple components or objects. Once loaded, HOOPS Exchange represents these as a model tree that you can traverse using the standard structure APIs.
To learn more about how HOOPS Exchange handles assemblies, see our tutorial about assembly traversal.
Views
This concept is not supported by OBJ.
Metadata and Attributes
HOOPS Exchange can expose colors, materials, layers, and user-defined metadata when they are present in the source file.
See attributes_and_metadata for details on how to query and interpret this information.