Game Development Reference
In-Depth Information
ply = oi.plys;
plycount = 0;
for(i=0;i<oi.numpolygons;i++){
if (ply->numverts!=3){
AfxMessageBox(”Sub division can only be
applied to triangular meshes”);
ClearPatchInfo();
return FALSE;
}
if (ply->p[0]==ptindex || ply->p[1]==ptindex || ply->p[2]==
ptindex){
plyscan[plycount++] = ply;
}
ply++;
}
if (plycount){
//Add first scanned polygon
if (plyscan[0]->p[0]==ptindex){
ptcon->p[0] = plyscan[0]->p[2];
ptcon->p[1] = plyscan[0]->p[1];
}
if (plyscan[0]->p[1]==ptindex){
ptcon->p[0] = plyscan[0]->p[0];
ptcon->p[1] = plyscan[0]->p[2];
}
if (plyscan[0]->p[2]==ptindex){
ptcon->p[0] = plyscan[0]->p[1];
ptcon->p[1] = plyscan[0]->p[0];
}
ptcon->valence = 2;
ptcon->border = 1;
vindex = ptcon->p[1];
plyscan[0] = NULL;
count = plycount-1;
while(count){
//Scan for edge ptindex>>vindex
found = FALSE;
for(plyindex=1; plyindex<plycount; plyindex++){
ply = plyscan[plyindex];
if (!ply) continue;
if (ply->p[0] == ptindex){
Search Nedrilad ::




Custom Search