시작하기

Aspose.3D FOSS for Java 시작하기

환영합니다 aspose-3d-foss, 무료이며 오픈소스 Java 라이브러리로 3D 씬을 로드하고, 구축하며, 내보낼 수 있습니다. 이 가이드는 새 프로젝트에서 몇 분 만에 작동하는 씬을 만들 수 있도록 안내합니다.


필수 조건

요구 사항세부 정보
JavaJDK 21 이상
빌드 도구Maven 또는 Gradle
OSWindows, macOS, 또는 Linux

설치

Maven 의존성을 귀하의 pom.xml:

<dependency>
  <groupId>com.aspose</groupId>
  <artifactId>aspose-3d-foss</artifactId>
  <version>26.1.0</version>
</dependency>

검증:

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.");
    }
}

다음 보기 설치 가이드 Gradle 설정 및 검증 단계에 대해.


가능한 작업

설치가 완료되면 바로 다음을 할 수 있습니다:

  • 로드 OBJ, STL, glTF 2.0 / GLB, 및 FBX 파일을 통해 scene.open()
  • 검사 씬 계층 구조: 탐색 Node 트리, 읽기 Mesh 지오메트리, 정점 노멀 및 UV에 접근
  • Transform 노드: 변환, 회전 및 스케일을 설정 Transform 클래스
  • 재료 적용: 할당 Material 또는 PbrMaterial 노드에
  • 내보내기 지원되는 모든 포맷으로 scene.save()
  • 기하학 구축: 생성 Mesh 제어점 및 폴리곤을 사용하여 프로그래밍 방식으로 객체 생성

빠른 시작

3D 파일을 로드하고, 씬 계층 구조를 출력한 뒤, GLB 형식으로 다시 저장합니다:

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");
    }
}

다음 단계

 한국어