Osd.PatchCoord 是 OpenSubdiv 库中的一个结构体,用于表示子图表面的 Patch 坐标系。
Osd.PatchCoord 结构体有以下成员变量:
int patchIndex:Patch 的索引。
unsigned char patchType:Patch 的类型,它的值应该为下列常量之一:
kNonPatch:非 Patch 类型。kRegular:正则类型 Patch。kBoundary:边界类型 Patch。kCorner:角落类型 Patch。kGregoryBilinear:Gregory Bilinear Patch 类型。kGregory:Gregory Patch 类型。int FaceIndex[4]:Patch 所在的面的四个控制点的索引。
unsigned char Rotation:Patch 的旋转次数(可能是 0、1、2 或 3)。
下面是一个使用 Osd.PatchCoord 的示例代码:
#include <opensubdiv/osd/patchCoord.h>
Osd.PatchCoord coord;
coord.patchIndex = 0;
coord.patchType = Osd.PatchCoord::kRegular;
coord.FaceIndex[0] = 5;
coord.FaceIndex[1] = 9;
coord.FaceIndex[2] = 12;
coord.FaceIndex[3] = 3;
coord.Rotation = 1;
更多关于 Osd.PatchCoord 的信息,可以参考以下资料: