Getting Started
Getting Started with Aspose.3D FOSS for Java
Welcome to aspose-3d-foss, a free, open-source Java library for loading, building, and exporting 3D scenes. This guide takes you from a fresh project to a working scene in minutes.
Prerequisites
| Requirement | Detail |
|---|---|
| Java | JDK 21 or later |
| Build tool | Maven or Gradle |
| OS | Windows, macOS, or Linux |
Installation
Add the Maven dependency to your pom.xml:
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-3d-foss</artifactId>
<version>26.1.0</version>
</dependency>Verify:
import com.aspose.threed.Scene;
public class Main {
public static void main(String[] args) {
Scene scene = new Scene();
System.out.println("aspose-3d-foss loaded successfully.");
}
}See the Installation Guide for Gradle setup and verification steps.
What You Can Do
Once installed you can immediately:
- Load OBJ, STL, glTF 2.0 / GLB, and FBX files via
scene.open() - Inspect scene hierarchies: traverse
Nodetrees, readMeshgeometry, access vertex normals and UVs - Transform nodes: set translation, rotation, and scale through the
Transformclass - Apply materials: assign
MaterialorPbrMaterialto nodes - Export to any supported format with
scene.save() - Build geometry: create
Meshobjects programmatically with control points and polygons
Quick Start
Load a 3D file, print the scene hierarchy, and re-save in GLB format:
import com.aspose.threed.Scene;
import com.aspose.threed.Node;
public class QuickStart {
public static void main(String[] args) throws Exception {
Scene scene = new Scene();
scene.open("input.obj");
System.out.println("Root children: " + scene.getRootNode().getChildNodes().size());
for (Node node : scene.getRootNode().getChildNodes()) {
String entityType = node.getEntity() != null
? node.getEntity().getClass().getSimpleName()
: "no entity";
System.out.println(" " + node.getName() + " [" + entityType + "]");
}
scene.save("output.glb");
System.out.println("Saved output.glb");
}
}Next Steps
- Installation Guide: Maven/Gradle setup and verification
- Developer Guide: Format support, mesh operations, materials, and transforms
- Features and Functionalities: Deep-dive into every feature area with Java examples