#include <nnsys/g3d/util.h>
int
NNS_G3dWorldPosToScrPos(
const VecFx32* pWorld,
int* px,
int* py
);
pWorld | Pointer to the world coordinate position |
px | Pointer to the x coordinate on the screen |
py | Pointer to the y coordinate on the screen |
Returns 0
if *px
and *py
are inside the viewport. Returns -1
if they are outside of the viewport.
Looks for the position on the screen that corresponds to the position on the world coordinates. The camera matrix and the projection matrix must be configured in the NNS_G3dGlb
structure. Even if the return value is -1
, the value is stored in *px
and *py
and can be used as the directional guide. When applying a horizontal offset to the 3D screen by using the Nitro-SDK G3X_SetHOffset
function, only the offset portion of the obtained x coordinate needs to be moved.
NNS_G3dLocalOriginToScrPos
, NNS_G3dScrPosToWorldLine
2004/11/01 Initial version.
CONFIDENTIAL