123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
void CPrimitive::CompareX(CPrimitive *obj,vecf A[],vecf B[],vecf c[]) { bool sort; do{ sort=false; for(int i=0;i<obj->NumTri;i++) { if(A[i].x > A[i+1].x) { temp1 = A[i].x; A[i].x=A[i+1].x; A[i+1].x = temp1; sort=true; } } }while(sort); do{ sort=false; for(int i=0;i<obj->NumTri;i++) { if(B[i].x > B[i+1].x) { temp2 = B[i].x; B[i].x = B[i+1].x; B[i+1].x = temp2; sort=true; } } }while(sort); do{ sort=false; for(int i=0;i<obj->NumTri;i++) { if(C[i].x > C[i+1].x) { temp3 = C[i].x; C[i].x = C[i+1].x; C[i+1].x = temp3; sort=true; } } }while(sort); }