API 参考 Aspose.3D 26.1.0 (.NET 10.0+,MIT 许可证)。.
所有类位于 Aspose.ThreeD 根命名空间。根 using 指令为::
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/4 和 Quaternion 和 Matrix4 使用大写字段访问。使用 Aspose.ThreeD.Utilities 用于几何工作的类型。.
核心场景图
| Methods | Methods |
|---|
Scene | 所有 3D 场景数据的顶层容器。保存根节点、资产元数据和动画剪辑。公开 Open() 和 Save() 作为主要的 I/O 入口点。. |
Node | 场景层次结构中的命名节点。拥有子节点列表和附加的 Entity 对象,例如网格、相机和灯光。携带本地 Transform. |
Entity | 所有可附加到的对象的抽象基类 Node. 提供名称和标识,但没有自己的几何体。. |
SceneObject | 被…共享的基类 Node 和 Entity.。提供用于用户自定义元数据的属性集合接口。. |
A3DObject | 所有 Aspose.3D 托管对象的根基类。公开该 Name 属性和该 Properties 集合。. |
INamedObject | 保证 a 的接口 Name 属性。由 Node, Entity, 以及多个特定格式的描述符类型。. |
几何与网格
| Methods | Methods |
|---|
Mesh | 多边形网格实体。存储控制点(顶点位置作为 Vector4),多边形面列表(控制点索引列表),以及顶点元素层(法线、UV、顶点颜色)。. |
Geometry | 网格类几何类型的抽象基类。定义控制点数组和集合的 VertexElement 层。. Mesh 继承自 Geometry. |
VertexElement | 几何体(normals, UVs, colours, etc.)上附加的数据层的抽象基类。携带 MappingMode, ReferenceMode,,以及数据列表。. |
VertexElementNormal | 根据映射模式,为每个顶点或每个多边形角存储一个法线向量。. |
VertexElementUV | 存储纹理坐标对(Vector2) 每个顶点或每个多边形角。. |
VertexElementVertexColor | 以…形式存储每顶点或每角的 RGBA 颜色数据 as Vector4. |
内置基元
| Methods | Methods |
|---|
Box | 参数化的轴对齐盒子,可配置宽度、高度和深度。可附加到 a Node 直接或转换为 Mesh 通过 ToMesh(). |
Sphere | 参数化球体,可配置半径。支持 ToMesh() 转换。. |
Cylinder | 参数化圆柱体,可配置顶部半径、底部半径和高度。支持 ToMesh() 转换。. |
变换与空间
| Methods | Methods |
|---|
Transform | 本地变换附加到 a Node.。提供 Translation (FVector3), Rotation (Quaternion), Scale (FVector3),和 Matrix (Matrix4) 属性。. |
GlobalTransform | 只读视图,显示在组合所有祖先变换后节点的世界空间变换矩阵。通过 node.GlobalTransform. 公开单个 Matrix 属性。. |
AssetInfo | 元数据块附加到 a Scene. 继承自 A3DObject 提供 Name 和 Properties. 未在此版本中定义其他属性。. |
材质与着色
| Methods | Methods |
|---|
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
| Methods | Methods |
|---|
Camera | 相机实体。继承自 Frustum.。附加到一个 Node 以定义视点变换。本版未公开特定格式的属性。. |
数学工具
| Methods | Methods |
|---|
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.Translation 和 Transform.Scale. |
FVector4 | 单精度 4 分量浮点向量(大写字段:: X, Y, Z, W). |
Quaternion | 用于表示旋转的单位四元数(W, X, Y, Z)。用于 Transform.Rotation. |
Matrix4 | 4x4 transformation matrix. Used for world/local transform computations and by GlobalTransform.Matrix. |
BoundingBox | 由以下定义的轴对齐包围盒 Minimum 和 Maximum FVector3 角落。. |
Methods
| Methods | Methods |
|---|
AnimationClip | 用于动画范围的具名容器。A Scene 可以容纳多个剪辑。. 声明存根 — 关键帧数据和播放尚未实现。. |
格式 I/O
| Methods | Methods |
|---|
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 格式
STL 格式
glTF 格式
FBX 格式
3MF Format
Methods
| Methods | Methods |
|---|
FileContentType | 内容类型描述符:: ASCII, Binary. 可作为属性在 FileFormat. |
Axis | 标识坐标轴:: XAxis, YAxis, ZAxis. |
CoordinateSystem | 指定手性约定:: RightHand 或 LeftHand. |
属性系统
| Methods | Methods |
|---|
Property | 在…上的单个具名类型属性 A3DObject. |
PropertyCollection | 可迭代集合的 Property 附加到…的对象 A3DObject. |
另请参阅