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

RequirementDetail
JavaJDK 21 or later
Build toolMaven or Gradle
OSWindows, 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 Node trees, read Mesh geometry, access vertex normals and UVs
  • Transform nodes: set translation, rotation, and scale through the Transform class
  • Apply materials: assign Material or PbrMaterial to nodes
  • Export to any supported format with scene.save()
  • Build geometry: create Mesh objects 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

See Also

 English