OBJ to glTF FBX

3D Object OBJ files contain 3D objects information like the texture and coordinates. You can convert an OBJ file to a GLTF or FBX file programmatically in Java. In some scenarios, you might need to convert an OBJ file to different files. In accordance with that, this article covers how to convert an OBJ file to GLTF or FBX file.

Java API to Convert OBJ to glTF GLB or FBX File

Aspose.3D for Java API supports manipulating 3D Object files like converting them to glTF GLB or FBX files. API. You can install the API by downloading the JAR file from the New Releases section or with the following Maven configurations in pom.xml file of your project:

Repository:

 <repositories>
    <repository>
        <id>AsposeJavaAPI</id>
        <name>Aspose Java API</name>
        <url>http://repository.aspose.com/repo/</url>
    </repository>
</repositories>

Dependency:

 <dependencies>
    <dependency>
        <groupId>com.aspose</groupId>
        <artifactId>aspose-3d</artifactId>
        <version>21.12</version>
    </dependency>
</dependencies>

Convert OBJ to glTF GLB File Programmatically in Java

You can convert an OBJ file to a glTF file in Java by following the steps below:

  1. Load the input OBJ file with the Scene constructor.
  2. Initialize a GltfSaveOptions class object.
  3. Save the output glTF GLB document.

The code snippet below demonstrates how to convert an OBJ file to glTF document in Java:

Convert OBJ to FBX File in Java

You can convert an OBJ file to an FBX file with the following steps:

  1. Load the input object OBJ file using the Scene class constructor.
  2. Initialize an object of FbxSaveOptions class.
  3. Save the output FBX file using the Save method.

The following code snippet shows how to convert an OBJ file to an FBX file programmatically using Java:

Conclusion

In this article, you have learned how to convert an OBJ object file to a glTF GLB or FBX file programmatically in Java. Moreover, you may take visit the API Reference or the documentation to learn other features offered by the API. In case of any concerns, please feel free to contact us at the forum.

See Also

Convert FBX to RVM or RVM to FBX File in Java