Class WavefrontReader
Wavefront
data record).
Additional information:
(1) Only triangulated .obj files are supported.
(2) OpenGL index drawing is NOT supported at the moment. The data (vertices, textureCoordinates,
normals) is duplicated. The duplication is defined by the faces (triangles) of the .obj file.
(3) The following .obj 'types' are supported:
- only vertices (face definition: 'f v1 v2 v3')
- vertices with texture coordinates (face definition: 'f v1/vt1 v2/vt2 v3/vt3)
- vertices with normals (face definition: f v1//vn1 v2//vn2 v3//vn3)
- vertices with texture coordinates and with normals (face definition: f v1//vn1 v2//vn2 v3//vn3)
Depending on the type, the belonging float Array inside the Wavefront data structure is
set. The missing data results in setting the belonging float Array to 'null'.
-
Method Summary
Modifier and TypeMethodDescriptionstatic WavefrontfromResource(String filename)Reads an .obj file from the resource folder.
-
Method Details
-
fromResource
Reads an .obj file from the resource folder.- Parameters:
filename- path to the file inside the resource folder- Returns:
- a
Wavefrontdata structure (float array) - Throws:
IOException- if reading the file fails for any reason
-