Реферат: Трехмерная графика Теория

Matrix m = MirrorY();

for ( int i = 0; i < PointNumber; i++ )

Point[i] = m * Point[i];

Center = m * Center;

Normal = m * Normal;

}

void Polygon :: PolyMirrorZ ()

{

Matrix m = MirrorZ();

for ( int i = 0; i < PointNumber; i++ )

Point[i] = m * Point[i];

Center = m * Center;

Normal = m * Normal;

}

void Polygon :: Draw ( const Vector& PrCenter )

{

int VisPoint[MaxPoints * 2], k = 0;

for ( int i = 0; i < PointNumber; i++ ) {

double Coeff = 1 / ( 1 - Point[i].z / PrCenter.z );

VisPoint[k++] = ( int ) Point[i].x * Coeff + 320;

VisPoint[k++] = ( int ) -Point[i].y * Coeff + 175;

}

setcolor ( Color );

setfillstyle ( 1, Color );

fillpoly ( PointNumber, VisPoint );

}

// GrObject's methods

GrObject :: GrObject ( Polygon * FacetArr, int FacetNum, const Vector& Crds )

{

К-во Просмотров: 1951
Бесплатно скачать Реферат: Трехмерная графика Теория