An OBJ file contains a three-dimensional object with coordinates, texture, and other object information. Whereas, the USDZ file format is an unencrypted and uncompressed ZIP archive for storing Universal Scene Description files. In some scenarios, you might want to convert an OBJ file to USDZ format. In accordance with such requirements, this article covers how to convert an OBJ file to a USDZ file programmatically in Java.
USDZ to OBJ Converter – Java API Installation
Aspose.3D for Java API can be used to create, edit, or manipulate 3D files. You can install the API by downloading its JAR files from the Downloads section or using the following details in the pom.xml file of your Maven-based project to install it from the Aspose Repository.
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>22.2</version>
</dependency>
</dependencies>
Convert OBJ to USDZ in Java
You can convert an OBJ file to USDZ with the steps listed below:
- Create an instance of the Scene class to load the input OBJ file.
- Instantiate an object of UsdSaveOptions class.
- Finally, convert OBJ to a USDZ file.
The following code snippet elaborates how to convert an OBJ file to USDZ format programmatically in Java:
Get Free Evaluation License
You can evaluate the API in its full capacity by requesting a free temporary license.
Conclusion
In this article, you have understood how to convert an OBJ file to USDZ format programmatically in Java. Furthermore, you may want to check out many other features offered by the API by taking a look at the documentation section. In case of any concerns, please feel free to contact us at the forum.