#include <OBJFile.h>
|
| typedef std::array< size_t, 3 > | IndexType |
| | Index triple forming one triangle (zero-based vertex indices).
|
|
| | OBJFile (const std::string &filename, bool normalize=false) |
| | Load an OBJ file.
|
|
| std::vector< IndexType > | indices |
| | Triangle index buffer (each element is one face as three indices).
|
| std::vector< Vec3 > | vertices |
| | Vertex positions parsed from "v" records (x,y,z).
|
| std::vector< Vec3 > | normals |
| | Per-vertex normals.
|
◆ IndexType
Index triple forming one triangle (zero-based vertex indices).
- Note
- Indices reference entries in vertices.
◆ OBJFile()
| OBJFile::OBJFile |
( |
const std::string & | filename, |
|
|
bool | normalize = false ) |
Load an OBJ file.
- Parameters
-
| filename | Path to the .obj file. |
| normalize | If true, recenter to AABB center and scale uniformly by the longest extent so the model fits into a unit cube. |
- Exceptions
-
| std::runtime_error | On I/O failures or malformed input (thrown from stream operations or conversions). |
◆ indices
Triangle index buffer (each element is one face as three indices).
◆ normals
| std::vector<Vec3> OBJFile::normals |
Per-vertex normals.
If the file lacks "vn" records, these are computed by summing face normals around each vertex and normalizing.
◆ vertices
| std::vector<Vec3> OBJFile::vertices |
Vertex positions parsed from "v" records (x,y,z).
The documentation for this class was generated from the following files: