Реферат: Трехмерная графика Теория
double denom = v.x * M.x [0][3] + v.y * M.x [1][3] +
v.z * M.x [2][3] + M.x[3][3];
if ( denom != 1.0 )
res /= denom;
return res;
}
Matrix Translate ( const Vector& Loc )
{
Matrix res ( 1 );
res.x [3][0] = Loc.x;
res.x [3][1] = Loc.y;
res.x [3][2] = Loc.z;
return res;
};
Matrix Scale ( const Vector& v )
{
Matrix res ( 1 );
res.x [0][0] = v.x;
res.x [1][1] = v.y;
res.x [2][2] = v.z;
return res;
};
Matrix RotateX ( double Angle )
{
Matrix res ( 1 );
double Cosine = cos ( Angle );
double Sine = sin ( Angle );
res.x [1][1] = Cosine;
res.x [2][1] = - Sine;