normalizeViewport

fun normalizeViewport(viewport: Rect, zNear: Float, zFar: Float, res: Point3D)

Normalizes the coordinates of a #graphene_point3d_t using the given viewport and clipping planes.

The coordinates of the resulting #graphene_point3d_t will be in the -1, 1 range.

Since

1.4

Parameters

viewport

a #graphene_rect_t representing a viewport

zNear

the coordinate of the near clipping plane, or 0 for the default near clipping plane

zFar

the coordinate of the far clipping plane, or 1 for the default far clipping plane

res

the return location for the normalized #graphene_point3d_t