Game Development Reference
In-Depth Information
}
//Create array of valid pairs
qp = k.CreateValidPairsArray(oi, qpTotal);
if (qpTotal<1) return FALSE;
for (i=0; i<qpTotal; i++) k.CalculateVDash(qp[i], q);
qparray = SortQuadricPairs(qp, qpTotal);
delete [] qp;
qp = qparray;
pTotal = oi.numpolygons;
vTotal = oi.numpoints;
//Now remove the edges
while(pTotal > polyTotal){
n = RemoveEdge(q, qp, qpTotal);
if (!n){
AfxMessageBox(”Unsuitable mesh for polygons
reduction”);
RestoreMesh();
return FALSE;
}
pTotal -= n;
vTotal-;
}
StreamlineMesh(q);
delete [] qparray;
delete [] q;
Transform();
return TRUE;
}
Having got an overview of the method, we will look in more detail at the
CQuadric class. The class contains a constructor that can be used to
create a quadric from the plane coefficients.
CQuadric::CQuadric(double a, double b, double c, double d)
{
q11 = a*a;
q12 = a*b;
Search Nedrilad ::




Custom Search