|
CGVIS Utils
|
Minimal Wavefront OBJ loader collecting vertices, triangle indices, and normals. More...
Go to the source code of this file.
Classes | |
| class | OBJFile |
Minimal Wavefront OBJ loader collecting vertices, triangle indices, and normals.
Parses a subset of the Wavefront OBJ format sufficient for simple triangle meshes. The constructor reads the file, extracts vertex positions ("v"), vertex normals ("vn"; optional), and triangular faces ("f"). Indices are stored zero-based. If normals are not provided, they are computed as area-weighted vertex normals from face geometry.
normalize is true, positions are recentered to the AABB center and uniformly scaled to fit into the unit cube (longest AABB side maps to 1).