今天发现,max自己的茶壶的Mesh,存在一个面有两个点的索引相同的情况。啊哈哈哈,mesh真是什么结构都有。有兴趣的可以试一下
View Code
for (int i=0; i<GetCOREInterface()->GetSelNodeCount(); i++)
{
Object * selectObject = ip->GetSelNode(i)->GetObjectRef();
TriObject *tri = (TriObject *)selectObject->ConvertToType(ip->GetTime(),Class_ID(TRIOBJ_CLASS_ID, 0));
Mesh tempMesh = tri->GetMesh();
int faceCount = tempMesh.numFaces;
for (int fi = 0;fi<faceCount;++fi)
{
Face tempface = tempMesh.faces[fi];
char v1char[10] = {'0'};
DWORD v1 = tempface.v[0];
ultoa(v1,v1char,10);
char v2char[10] = {'0'};
DWORD v2 = tempface.v[1];
ultoa(v2,v2char,10);
char v3char[10] = {'0'};
DWORD v3 = tempface.v[2];
ultoa(v3,v3char,10);
char fichar[10] = {'0'};
ultoa(fi,fichar,10);
mputs("fi : ");
mputs(fichar);
mputs(" | ");
mputs(v1char);
mputs(" , ");
mputs(v2char);
mputs(" , ");
mputs(v3char);
mputs("\r\n");
}