始まること
始まる Aspose.3D FOSS for Java
ようこそ → トップ > 3Dフォス,無料でオープンソースのJava図書館で、3Dシーンをダウンロード、構築、輸出します。このガイドは新鮮なプロジェクトから数分で作業シーンへと導きます。.
原則
| 要求事項 | 詳細 |
|---|---|
| Java | JDK 21 以降 |
| ツール構築 | マベンまたはグラドル |
| OS | Windows、MacOS、Linuxなど |
インストール
あなたのMaven依存を追加する pom.xml:
<dependency>
<groupId>org.aspose</groupId>
<artifactId>aspose-3d-foss</artifactId>
<version>26.5.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.");
}
}見る The インストールガイド グラドル設定と検証ステップについて。.
何ができるか
インストールすると、すぐに:
- 負荷 OBJ、STL、glTF 2.0 / GLB、および FBX ファイルを介して
scene.open() - 検査 ステージ・イラクシー:Cross
Node木、読むMesh地理学、アクセス垂直正常とUV - 変換 ノード:設定翻訳、回転、およびスケールを通して
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");
}
}