Class ObjExporter

java.lang.Object
com.ardor3d.extension.model.obj.ObjExporter

public class ObjExporter extends Object
WaveFront OBJ exporter. It supports only the meshes. Several meshes can be exported into the same OBJ file. Only a few kinds of primitives are supported. N.B: If the texture is flipped in Ardor3D, you will have to flip it manually when loading the resulting OBJ file.
  • Constructor Details

    • ObjExporter

      public ObjExporter()
  • Method Details

    • save

      public void save(Mesh mesh, File objFile, File mtlFile) throws IOException
      Save a mesh to a single WaveFront OBJ file and a MTL file
      Parameters:
      mesh - mesh to export
      objFile - WaveFront OBJ file
      mtlFile - material file, optional
      Throws:
      IOException - exception
    • save

      public void save(List<Mesh> meshList, File objFile, File mtlFile, String customTextureName) throws IOException
      Save several meshes to a single WaveFront OBJ file and a MTL file
      Parameters:
      meshList - meshes to export
      objFile - WaveFront OBJ file
      mtlFile - material file, optional
      customTextureName - texture name that overrides the one of the mesh (except in key frames), optional
      Throws:
      IOException - exception
    • save

      protected void save(Mesh mesh, File objFile, File mtlFile, boolean append, int firstVertexIndex, boolean firstFiles, List<ObjMaterial> materialList, String customTextureName) throws IOException
      Save a mesh to the given files.
      Parameters:
      mesh - mesh to export
      objFile - WaveFront OBJ file
      mtlFile - material file, optional
      append - indicates whether the data are written to the end of the OBJ file
      firstVertexIndex - first vertex index used for this mesh during the export
      firstFiles - indicates whether the couple of files is used for the first time, i.e there is nothing to append despite the value of append
      materialList - list of materials already exported in this material file
      customTextureName - texture name that overrides the one of the mesh, optional
      Throws:
      IOException - exception