将资产信息添加到场景
Contents
[
Hide
]
将资产信息添加到 3D 场景
元数据是描述、解释、定位或使其更容易检索、使用或管理信息资源的结构化信息。Aspose.3D for .NET API 允许开发人员定义场景的元数据。
为场景定义元数据
3D 显示产生大量元数据和图片信息。元数据是一种资产,也是节目的一部分。
- 使用
Scene
类初始化 3D 场景。 - 设置应用程序/工具名称。
- 设置应用程序/工具供应商名称。
- 设置测量单位。
- 设置测量单位比例系数。
- 以支持的文件格式保存 3D 场景。
在此示例中,我们假设场景是由名为 “Egypt” 的 CAD 工具创建的,并且由 “Manualdesk” 设计:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET | |
// Initialize a 3D scene | |
Scene scene = new Scene(); | |
// Set application/tool name | |
scene.AssetInfo.ApplicationName = "Egypt"; | |
// Set application/tool vendor name | |
scene.AssetInfo.ApplicationVendor = "Manualdesk"; | |
// We use ancient egyption measurement unit Pole | |
scene.AssetInfo.UnitName = "pole"; | |
// One Pole equals to 60cm | |
scene.AssetInfo.UnitScaleFactor = 0.6; | |
// Save scene to 3D supported file formats | |
scene.Save("InformationToScene.fbx"); |