|
|
发表于 2005-11-1 18:21:00
|
显示全部楼层
Re:请问Max插件因顶点纹理坐标问题而产生的问题
那这么写:
for(int i=0; i < pMesh->numFaces; i++ )
{
int vi1 = pMesh->faces[ i ].v[ 0 ];
int vi2 = pMesh->faces[ i ].v[ 0 ];
int vi3 = pMesh->faces[ i ].v[ 0 ];
int ti1 = pMesh->tvFace[ i ].t[ 0 ];
int ti2 = pMesh->tvFace[ i ].t[ 0 ];
int ti3 = pMesh->tvFace[ i ].t[ 0 ];
// write vi1/ti1, vi2/ti2, vi3/ti3
}
for(int i=0; i < pMesh->numVerts; i++ )
{
Point3 v1 = pMesh->getVert(i);
Point3 v2 = pMesh->getVert(i);
Point3 v3 = pMesh->getVert(i);
// write v1,v2,v3
}
for(int i=0; i < pMesh->numTVerts; i++ )
{
UVVert t1 = pMesh->getTVert(i);
UVVert t2 = pMesh->getTVert(i);
UVVert t3 = pMesh->getTVert(i);
// write t1,t2,t3
}
纹理坐标的总数和顶点的总数并不相等,对它们使用的索引也是分开的。
你的代码里这句话最让我困惑
if( pMesh->tvFace[k].t[l] == j ) |
|