Ninja Library - Matrix Function

njProjectScreen

Projects an arbitrary point onto the screen

FORMAT

void njProjectScreen(*m, *p3, *p2)
NJS_MATRIX *m
NJS_POINT3 *p3
NJS_POINT2 *p2

PARAMETER

 *m   Calculation matrix 
 *p3  Coordinates of arbitrary point 
 *p2  Point coordinates after projection 

RETURN

None

DESCRIPTION

Projects an arbitrary point onto the screen and returns the value (parameter pointer) found as result. When parameter *m is NULL, the current matrix is used for calculation.

EXAMPLE

The following projects point ps(100, 200, 300) onto the screen.
NJS_MATRIX stack[10];
NJS_VIEW view;
NJS_POINT3 p3;
NJS_POINT2 p2;
p3.x = 100.f;
p3.y = 200.f;
p3.z = 300.f;
njInitMatrix(stack, 10);
njInitView(&view);
njSetView(&view);
njClearMatrix();
njPushMatrix(NULL);
njProjectScreen(NULL, &p3, &p2);
njPopMatrix(1);
% Result %
p2(153.333328, 573.333374)

njProjectScreen
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999