# NNS_G3dLocalOriginToScrPos

## C Specification

      #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 of the local coordinate origin on the screen. The current position matrix and the current projection matrix must be appropriately configured. Even if the return value is `-1`, the value is stored in `*px` and `*py` can be used as a 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.

## See Also

`NNS_G3dWorldPosToScrPos`, `NNS_G3dScrPosToWorldLine`

## Revision History

11/01/2004 Initial version.