*p | Point coordinates in 3D space |
*sx | X coordinates after projection |
*sy | Y coordinates after projection |
OK | The coordinates after projection lie within the screen's drawing area | |
NG | The coordinates after projection fall outside of the screen's drawing area |
The following projects the point at (1000, 1000, 1000) in 3D space onto the screen, then finds the screen coordinates. NJS_POINT3 p; Float sx, sy; p.x = 1000.f; p.y = 1000.f; p.z = 1000.f; sbInitSystem( NJD_RESOLUTION_640x480_NTSCNI, NJD_FRAMEBUFFER_MODE_RGB565, 1 ); njCalcScreen(&p, &sx, &sy); % Result % NG sx = 820.000000, sy = 740.000000