Exemplo n.º 1
0
//
// MultiplyNormal
//
Nixin::Point Nixin::Point::MultiplyNormal( const Point& normal, const Matrix&b )
{
	Point			 result			= Point();
	
	result.x = b.GetDataAt( 0, 0 ) * normal.x + b.GetDataAt( 0, 1 ) * normal.y + b.GetDataAt( 0, 2 ) * normal.z;
	result.y = b.GetDataAt( 1, 0 ) * normal.x + b.GetDataAt( 1, 1 ) * normal.y + b.GetDataAt( 1, 2 ) * normal.z;
	result.z = b.GetDataAt( 2, 0 ) * normal.x + b.GetDataAt( 2, 1 ) * normal.y + b.GetDataAt( 2, 2 ) * normal.z;
	
	return result;
}
Exemplo n.º 2
0
//
// Multiply
// Multiplies a Point with an Matrix, and returns the resulting point
//
Nixin::Point Nixin::Point::Multiply( const Point& a, const Matrix& b )
{
	Point			 result			= Point();
	
	result.x = b.GetDataAt( 0, 0 ) * a.x + b.GetDataAt( 0, 1 ) * a.y + b.GetDataAt( 0, 2 ) * a.z +  b.GetDataAt( 0, 3 );
	result.y = b.GetDataAt( 1, 0 ) * a.x + b.GetDataAt( 1, 1 ) * a.y + b.GetDataAt( 1, 2 ) * a.z +  b.GetDataAt( 1, 3 );
	result.z = b.GetDataAt( 2, 0 ) * a.x + b.GetDataAt( 2, 1 ) * a.y + b.GetDataAt( 2, 2 ) * a.z +  b.GetDataAt( 2, 3 );
	
	return result;
}