Реферат: Трехмерная графика Теория
double d;
BSPNode * Left;
BSPNode * Right;
};
class Space
{
public:
int ObjectNumber;
GrObject * Object [MaxObjects];
Space () { ObjectNumber = 0; };
Space ( GrObject *, int );
void Add ( GrObject * );
void Draw ( const Vector& );
};
int IsVisible ( const Polygon&, const Vector& );
void DrawBSPTree ( BSPNode *, const Vector& );
#endif
//----------------------------------------------------------------------------
//Файл 3dworks.cpp
#include "3dworks.h"// Polygon's methodsPolygon :: Polygon ( Vector * PointArr, int PointNum, int Col, int TS ){ if ( PointNum <= MaxPoints ) { PointNumber = PointNum; Point = PointArr; Color = Col; TwoSides = TS;
Normal = Normalize (
( Point [1] - Point [0] ) ^ ( Point [PointNumber-1] - Point [0] ));
Center = 0;
for ( int i = 0; i < PointNumber; i++ )
Center += Point[i];
Center /= PointNumber;
}
}
void Polygon :: Move ( const Vector& v )