njCalcScreen Japanese
--|INDEX|->
Projects points in 3D space onto the screen, then finds the screen coordinates to which the points are projected.

FORMAT

#include <Ninja.h>

int njCalcScreen(*p, *sx, *sy)
NJS_POINT3 *p
Float *sx
Float *sy

PARAMETERS

NJS_POINT3 *p
point coordinates in 3D space
Float *sx
x coordinate after projection
Float *sy
y coordinate after projection

RETURN VALUE

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.

FUNCTION


EXAMPLE

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;

njInitSystem(NJD_RESOLUTION_640x480, 1);
njCalcScreen(&p, &sx, &sy);

% Result %

NG
sx = 820.000000, sy = 740.000000

NOTES


RELATED TOPICS

njInitSystem()
njSetScreen()
njSetAspect()
njClip2D()
njClipZ()

njCalcScreen
--|INDEX|->

Copyright SEGA ENTERPRISES, LTD., 1997