Class MeshObjExporter
java.lang.Object
cz.fidentis.analyst.data.mesh.impl.io.MeshObjExporter
Utility class for exporting model to .obj file (vertices, normals and triangles)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
exportModelToObj
(MeshModel model, File exportFile) Exports all facets of the model to .obj file.protected static void
writePolygons
(MeshFacet facet, BufferedWriter out) protected static int
writePolygonVertex
(MeshFacet facet, int vIndex, BufferedWriter out) protected static void
writeTexCoordinates
(MeshFacet facet, DecimalFormat df, BufferedWriter out) protected static void
writeVertexNormals
(MeshFacet facet, DecimalFormat df, BufferedWriter out) protected static void
writeVertices
(MeshFacet facet, DecimalFormat df, BufferedWriter out)
-
Constructor Details
-
MeshObjExporter
public MeshObjExporter()
-
-
Method Details
-
exportModelToObj
Exports all facets of the model to .obj file. Also, the .mtl file is created and referenced from the .obj. It includes the reference to the .jpg texture file with the same name as the .obj file.- Parameters:
model
- Model to be exported.exportFile
- File to which model is exported- Throws:
IOException
- on IO or data format error
-
writeVertices
protected static void writeVertices(MeshFacet facet, DecimalFormat df, BufferedWriter out) throws IOException - Throws:
IOException
-
writeVertexNormals
protected static void writeVertexNormals(MeshFacet facet, DecimalFormat df, BufferedWriter out) throws IOException - Throws:
IOException
-
writeTexCoordinates
protected static void writeTexCoordinates(MeshFacet facet, DecimalFormat df, BufferedWriter out) throws IOException - Throws:
IOException
-
writePolygons
- Throws:
IOException
-
writePolygonVertex
protected static int writePolygonVertex(MeshFacet facet, int vIndex, BufferedWriter out) throws IOException - Throws:
IOException
-