Enumerations
Enumerations — Aspose.3D TypeScript API Reference
包:: @aspose/3d (v24.12.0)
所有公开的枚举已导出自 @aspose/3d. 每个枚举都实现为一个类,具有静态单例成员,而不是 TypeScript enum,,这使得值成为不透明的令牌,无法与原始字符串或数字混淆。.
import {
ProjectionType,
LightType,
TextureMapping,
BooleanOperation,
VertexElementType,
MappingMode,
ReferenceMode,
} from '@aspose/3d';ProjectionType
相机投影模型。.
export class ProjectionType {
static PERSPECTIVE: ProjectionType;
static ORTHOGRAPHIC: ProjectionType;
}| Properties | Properties |
|---|---|
PERSPECTIVE | 标准透视投影;对象随距离增大而变小。. |
ORTHOGRAPHIC | 平行投影;对象的比例在任何深度下保持不变。用于 CAD 和等轴视图。. |
Properties
import { Scene, Camera, ProjectionType } from '@aspose/3d';
const scene = new Scene();
const cam = new Camera();
cam.projectionType = ProjectionType.ORTHOGRAPHIC;
scene.rootNode.createChildNode('cam', cam);LightType
光源类别。.
export class LightType {
static POINT: LightType;
static DIRECTIONAL: LightType;
static SPOT: LightType;
static AREA: LightType;
static VOLUME: LightType;
}| Properties | Properties |
|---|---|
POINT | 从空间中的一点向所有方向均匀发光。. |
DIRECTIONAL | 来自概念上无限远距离的平行光线(例如,阳光)。. |
SPOT | 锥形光,具有内锥角和外锥角。. |
AREA | 用于 PBR 流程中软阴影的平面自发光表面。. |
VOLUME | 体积光源。. |
Properties
import { Scene, Light, LightType } from '@aspose/3d';
const scene = new Scene();
const sun = new Light();
sun.lightType = LightType.DIRECTIONAL;
scene.rootNode.createChildNode('sun', sun);TextureMapping
标识 UV 元素绑定的纹理通道。.
export class TextureMapping {
static DIFFUSE: TextureMapping;
static SPECULAR: TextureMapping;
static AMBIENT: TextureMapping;
static EMISSIVE: TextureMapping;
static NORMAL: TextureMapping;
static BUMP: TextureMapping;
static OPACITY: TextureMapping;
static GLOW: TextureMapping;
static REFLECTION: TextureMapping;
static SHADOW: TextureMapping;
static SHININESS: TextureMapping;
static DISPLACEMENT: TextureMapping;
}| Properties | Properties |
|---|---|
DIFFUSE | 基础颜色/反照率通道。最常用的 UV 集。. |
SPECULAR | 镜面颜色或反射率通道。. |
AMBIENT | 环境光颜色覆盖通道。. |
EMISSIVE | 自发光发射通道。. |
NORMAL | 切线空间法线贴图通道。. |
BUMP | 基于高度的凹凸贴图通道。. |
OPACITY | Alpha / 透明度通道。. |
GLOW | 泛光/辉光强度通道。. |
REFLECTION | 环境反射通道。. |
SHADOW | 阴影投射通道。. |
SHININESS | 高光指数/粗糙度通道。. |
DISPLACEMENT | 几何位移通道。. |
Properties
import { Mesh, TextureMapping, MappingMode, ReferenceMode } from '@aspose/3d';
const mesh = new Mesh();
// ... add control points and polygons ...
const uv = mesh.createElementUV(TextureMapping.DIFFUSE, MappingMode.CONTROL_POINT, ReferenceMode.DIRECT);BooleanOperation
构造实体几何(CSG)操作类型。.
export class BooleanOperation {
static ADD: BooleanOperation;
static SUB: BooleanOperation;
static INTERSECT: BooleanOperation;
}| Properties | Properties |
|---|---|
ADD | 并集:合并两个操作数的体积。. |
SUB | 减法:从第一个操作数中移除第二个操作数的体积。. |
INTERSECT | 交集:仅保留两个操作数共享的体积。. |
BooleanOperation 存储为由 CSG 导入器生成的节点的元数据。. @aspose/3d 不执行运行时布尔求值;该枚举描述了记录在源文件中的意图。.
VertexElementType
语义类型用于 VertexElement 数据层。.
export class VertexElementType {
static BINORMAL: VertexElementType;
static NORMAL: VertexElementType;
static TANGENT: VertexElementType;
static MATERIAL: VertexElementType;
static POLYGON_GROUP: VertexElementType;
static UV: VertexElementType;
static VERTEX_COLOR: VertexElementType;
static SMOOTHING_GROUP: VertexElementType;
static VERTEX_CREASE: VertexElementType;
static EDGE_CREASE: VertexElementType;
static USER_DATA: VertexElementType;
static VISIBILITY: VertexElementType;
static SPECULAR: VertexElementType;
static WEIGHT: VertexElementType;
static HOLE: VertexElementType;
}| Properties | Properties |
|---|---|
NORMAL | 表面法线向量。. |
UV | 纹理 UV 坐标。. |
VERTEX_COLOR | 每顶点 RGBA 颜色。. |
TANGENT | 用于法线贴图的切线向量。. |
BINORMAL | 副切线(bitangent)向量。. |
SMOOTHING_GROUP | 每个多边形的平滑组整数 ID。. |
MATERIAL | 每个多边形的材质索引。. |
POLYGON_GROUP | 多边形分组索引。. |
VERTEX_CREASE | 细分顶点折痕权重。. |
EDGE_CREASE | 细分边折痕权重。. |
USER_DATA | 任意用户定义的通道。. |
VISIBILITY | 每个元素的可见性标志。. |
SPECULAR | 高光颜色或强度层。. |
WEIGHT | 蒙皮混合权重。. |
HOLE | 多边形孔标志。. |
MappingMode
控制每个顶点元素值关联的几何基元。.
export class MappingMode {
static CONTROL_POINT: MappingMode;
static POLYGON_VERTEX: MappingMode;
static POLYGON: MappingMode;
static EDGE: MappingMode;
static ALL_SAME: MappingMode;
}| Properties | Properties |
|---|---|
CONTROL_POINT | 每个控制点(顶点)一个值。. |
POLYGON_VERTEX | 每个多边形角(面-顶点)一个值。. |
POLYGON | 每个多边形一个值。. |
EDGE | 每条边一个值。. |
ALL_SAME | 单个值适用于整个网格。. |
ReferenceMode
控制顶点元素数据数组的索引方式。.
export class ReferenceMode {
static DIRECT: ReferenceMode;
static INDEX: ReferenceMode;
static INDEX_TO_DIRECT: ReferenceMode;
}| Properties | Properties |
|---|---|
DIRECT | 顺序访问 — 不使用索引数组。. |
INDEX | 单独的索引数组指向数据数组。. |
INDEX_TO_DIRECT | 索引数组将每个映射基元映射到数据数组中的位置。. |