Aspose.3D FOSS for .NET

API 参考 Aspose.3D 26.1.0 (.NET 10.0+,MIT 许可证)。.

所有类位于 Aspose.ThreeD 根命名空间。根 using 指令为::

using Aspose.ThreeD;

C# 命名约定:: 所有属性使用标准的 C# 属性语法。例如,使用 scene.RootNode 而不是 scene.getRootNode(),,并且 transform.Translation = ... 而不是 transform.setTranslation(...).

向量字段命名大小写:: 该库提供两套向量类型。. Aspose.ThreeD.Utilities.Vector2/3/4 (用于 Mesh.ControlPoints,,几何学,以及大多数数学运算)是 双精度 带有 小写 公共字段(v.x, v.y, v.z, v.w). 更简单的 Aspose.ThreeD.Vector2/3/4 结构体(中 Vector.cs) 是 单精度(float) 带有 大写 公共字段 (v.X, v.Y, v.Z). FVector2/3/4QuaternionMatrix4 使用大写字段访问。使用 Aspose.ThreeD.Utilities 用于几何工作的类型。.


核心场景图

MethodsMethods
Scene所有 3D 场景数据的顶层容器。保存根节点、资产元数据和动画剪辑。公开 Open()Save() 作为主要的 I/O 入口点。.
Node场景层次结构中的命名节点。拥有子节点列表和附加的 Entity 对象,例如网格、相机和灯光。携带本地 Transform.
Entity所有可附加到的对象的抽象基类 Node. 提供名称和标识,但没有自己的几何体。.
SceneObject被…共享的基类 NodeEntity.。提供用于用户自定义元数据的属性集合接口。.
A3DObject所有 Aspose.3D 托管对象的根基类。公开该 Name 属性和该 Properties 集合。.
INamedObject保证 a 的接口 Name 属性。由 Node, Entity, 以及多个特定格式的描述符类型。.

几何与网格

MethodsMethods
Mesh多边形网格实体。存储控制点(顶点位置作为 Vector4),多边形面列表(控制点索引列表),以及顶点元素层(法线、UV、顶点颜色)。.
Geometry网格类几何类型的抽象基类。定义控制点数组和集合的 VertexElement 层。. Mesh 继承自 Geometry.
VertexElement几何体(normals, UVs, colours, etc.)上附加的数据层的抽象基类。携带 MappingMode, ReferenceMode,,以及数据列表。.
VertexElementNormal根据映射模式,为每个顶点或每个多边形角存储一个法线向量。.
VertexElementUV存储纹理坐标对(Vector2) 每个顶点或每个多边形角。.
VertexElementVertexColor以…形式存储每顶点或每角的 RGBA 颜色数据 as Vector4.

内置基元

MethodsMethods
Box参数化的轴对齐盒子,可配置宽度、高度和深度。可附加到 a Node 直接或转换为 Mesh 通过 ToMesh().
Sphere参数化球体,可配置半径。支持 ToMesh() 转换。.
Cylinder参数化圆柱体,可配置顶部半径、底部半径和高度。支持 ToMesh() 转换。.

变换与空间

MethodsMethods
Transform本地变换附加到 a Node.。提供 Translation (FVector3), Rotation (Quaternion), Scale (FVector3),和 Matrix (Matrix4) 属性。.
GlobalTransform只读视图,显示在组合所有祖先变换后节点的世界空间变换矩阵。通过 node.GlobalTransform. 公开单个 Matrix 属性。.
AssetInfo元数据块附加到 a Scene. 继承自 A3DObject 提供 NameProperties. 未在此版本中定义其他属性。.

材质与着色

MethodsMethods
Material抽象基类,适用于所有材料类型。提供名称和属性集合。.
LambertMaterial经典的仅漫反射材质,具有 Ambient, Diffuse, Emissive, Reflective, Transparency,,以及 Texture 属性。命名空间:: Aspose.ThreeD.Shading.
PhongMaterial扩展 Lambert,带有 Specular, Shininess,,以及 SpecularPower 属性。命名空间:: Aspose.ThreeD.Shading.
PbrMaterial基于物理的渲染材质,带有 BaseColor, Metallic, Roughness, Occlusion,,以及纹理槽属性。命名空间:: Aspose.ThreeD.Shading.

Methods

MethodsMethods
Camera相机实体。继承自 Frustum.。附加到一个 Node 以定义视点变换。本版未公开特定格式的属性。.

数学工具

MethodsMethods
Vector2双精度 2-component vector (lowercase fields: x, y). 命名空间:: Aspose.ThreeD.Utilities. 用于 UV 纹理坐标。.
Vector3双精度 3-component vector (lowercase fields: x, y, z). 命名空间:: Aspose.ThreeD.Utilities. 通用空间向量,用于几何。.
Vector4双精度 4-component vector (lowercase fields: x, y, z, w). 命名空间:: Aspose.ThreeD.Utilities. 用于 Mesh.ControlPoints 和普通数据。.
FVector3单精度 3 分量浮点向量(大写字段:: X, Y, Z). 被 Transform.TranslationTransform.Scale.
FVector4单精度 4 分量浮点向量(大写字段:: X, Y, Z, W).
Quaternion用于表示旋转的单位四元数(W, X, Y, Z)。用于 Transform.Rotation.
Matrix44x4 transformation matrix. Used for world/local transform computations and by GlobalTransform.Matrix.
BoundingBox由以下定义的轴对齐包围盒 MinimumMaximum FVector3 角落。.

Methods

MethodsMethods
AnimationClip用于动画范围的具名容器。A Scene 可以容纳多个剪辑。. 声明存根 — 关键帧数据和播放尚未实现。.

格式 I/O

MethodsMethods
Scene.Open(path)打开文件,根据扩展名检测格式,并填充场景。.
Scene.Open(path, options)以特定格式打开文件 LoadOptions.
Scene.Open(stream)从流中打开,自动根据内容检测格式。.
Scene.Open(stream, options)以特定格式从流中打开 LoadOptions.
Scene.Save(path)将场景保存到文件;根据扩展名推断格式。.
Scene.Save(path, options)以特定格式保存 SaveOptions.
Scene.Save(stream, options)以特定格式保存到流 SaveOptions.
FileFormat受支持文件格式的注册表。使用 FileFormat.Formats (一个 IList<FileFormat>) 列举所有受支持的格式,或 FileFormat.Detect(fileName) 通过文件名检测格式。命名常量(ObjFormat, GltfFormat, FbxFormat,,等)是 internal 且不可从用户代码访问。.
IOService内部 I/O 抽象。提供 DetectFormat() 用于基于流的格式检测。.
LoadOptions格式特定加载选项的基类。.
SaveOptions格式特定保存选项的基类。.

OBJ 格式

MethodsMethods
ObjLoadOptionsWavefront OBJ 文件的加载选项。.
ObjSaveOptionsWavefront OBJ 输出的保存选项。.

STL 格式

MethodsMethods
StlLoadOptions加载 STL 文件的选项。.
StlSaveOptions保存 STL 输出的选项。.

glTF 格式

MethodsMethods
GltfLoadOptions加载 glTF 2.0 和 GLB 文件的选项。.
GltfSaveOptions保存 glTF 2.0 和 GLB 输出的选项。本版本未公开特定格式的属性;使用 .glb 扩展用于二进制输出。.

FBX 格式

MethodsMethods
FbxLoadOptions加载 FBX 文件的选项。.
FbxSaveOptionsFBX 输出的保存选项。FBX 导出始终生成二进制输出;此版本中未启用 ASCII FBX 导出。.

3MF Format

MethodsMethods
TmfLoadOptions3MF 文件的加载选项。.
TmfSaveOptions3MF 输出的保存选项。.

Methods

MethodsMethods
FileContentType内容类型描述符:: ASCII, Binary. 可作为属性在 FileFormat.
Axis标识坐标轴:: XAxis, YAxis, ZAxis.
CoordinateSystem指定手性约定:: RightHandLeftHand.

属性系统

MethodsMethods
Property在…上的单个具名类型属性 A3DObject.
PropertyCollection可迭代集合的 Property 附加到…的对象 A3DObject.

另请参阅

 中文