翻譯|使用教程|編輯:胡濤|2022-07-25 09:47:40.103|閱讀 454 次
概述:本文解釋了如何在 Java 中以編程方式將 USDZ 轉(zhuǎn)換為 GLB 或 GLTF 格式。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
USDZ文件是沒(méi)有任何壓縮或加密的 ZIP 文件。在某些用例中,您可能需要將 USDZ 文件轉(zhuǎn)換為 USDZ 文件為GLB或GLTF文件格式。因此,本文解釋了如何在 Java 中以編程方式將 USDZ 轉(zhuǎn)換為 GLB 或 GLTF 格式。
Aspose.3D for Java 支持處理多個(gè)二維或三維對(duì)象和場(chǎng)景。您可以通過(guò)從下載頁(yè)面下載其最新版本的 JAR 文件或使用以下配置來(lái)快速配置 API,以從項(xiàng)目的 pom.xml 文件中的Aspose 存儲(chǔ)庫(kù)中啟用它。
存儲(chǔ)庫(kù):
<repositories> <repository> <id>AsposeJavaAPI</id> <name>Aspose Java API</name> <url>//repository.aspose.com/repo/</url> </repository> </repositories>
依賴:
<dependencies> <dependency> <groupId>com.aspose</groupId> <artifactId>aspose-3d</artifactId> <version>22.7</version> </dependency> </dependencies>
您可以通過(guò)以下步驟將 USDZ 文件轉(zhuǎn)換為 GLB 格式:
下面的代碼示例詳細(xì)說(shuō)明了如何在 Java 中以編程方式將 USDZ 文件轉(zhuǎn)換為 GLB 格式:
// Initialize an object of Scene class com.aspose.threed.Scene scene = new com.aspose.threed.Scene(); // Open the scene from the given path scene.open("Input.usdz"); // Save output GLB file scene.save("Output.glb");
您可以使用以下步驟將 USDZ 文件轉(zhuǎn)換為 GLTF 格式:
以下代碼片段說(shuō)明了如何在 Java 中以編程方式將 USDZ 文件轉(zhuǎn)換為 GLTF 格式:
// Initialize an object of Scene class com.aspose.threed.Scene scene = new com.aspose.threed.Scene(); // Open the scene from the given path scene.open("Input.usdz"); // Save output GLTF file scene.save("Output.gltf");
在本文中,您學(xué)習(xí)了如何在 Java 中以編程方式將 USDZ 文件轉(zhuǎn)換為 GLTF 或 GLB 文件格式。Save 方法可以從文件名中解析文件擴(kuò)展名,并以相應(yīng)的格式呈現(xiàn)文件。例如,根據(jù)您的要求使用 ASCII 或二進(jìn)制格式文件。此外,您可以訪問(wèn)文檔空間以查看 API 支持的其他功能。
歡迎下載|體驗(yàn)更多Aspose產(chǎn)品
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn