new MeshIO()
Methods
-
<static> readOBJ(input)
-
Converts text from an OBJ file to a polygon soup mesh.
Parameters:
Name Type Description inputstring The text from an OBJ file containing vertex positions
and indices.Returns:
A polygon soup mesh containing vertex positions and indices.
Vertex positions and indices are keyed by "v" and "f" respectively.- Type
- Object
-
<static> writeOBJ(polygonSoup)
-
Converts a polygon soup mesh to the OBJ file format.
Parameters:
Name Type Description polygonSoupObject A polygon soup mesh containing vertex positions
and indices. Texture coordinates and normals are optional.Properties
Name Type Description vArray.<module:LinearAlgebra.Vector> The vertex positions of the polygon soup mesh.
vtArray.<module:LinearAlgebra.Vector> The texture coordinates of the polygon soup mesh.
vnArray.<module:LinearAlgebra.Vector> The normals of the polygon soup mesh.
fArray.<number> The indices of the polygon soup mesh.
Returns:
Text containing vertex positions, texture coordinates, normals
and indices in the OBJ format.- Type
- string