# NNS_G3dLocalOriginToScrPos

## Syntax

      #include <nnsys/g3d/util.h>

      int
      NNS_G3dLocalOriginToScrPos(
          int* px,
          int* py
      );

## Arguments

px | Pointer to the `x` coordinate on the screen
py | Pointer to the `y` coordinate on the screen

## Return Values

Returns `0` if `*px` and `*py` are inside the viewport. Returns -1 if they are outside of the viewport.

## Description

Looks for the position on the screen of the local coordinate system's origin. The current position coordinate matrix and the current projection matrix must be appropriately configured. Even if the return value is -1, values are stored in `*px` and `*py` and can be used as a directional guide. When applying a horizontal offset to the 3D plane by using the Nitro-SDK `G3X_SetHOffset` function, it is necessary to move the obtained `x` coordinate by the amount of the offset.

## See Also

`NNS_G3dWorldPosToScrPos`, `NNS_G3dScrPosToWorldLine`

## Revision History

2004/11/01 Initial version.

CONFIDENTIAL