Function projectDepth

projectDepth(p, model, proj, view) transforms the specified 3D object coordinates $p$ into 2D window coordinates $q$ and returns the depth.

  • Parameters

    • p: Vec3

      3D object coordinates (x,y,z)

    • model: Num[][]

      4x4 modelview matrix

    • proj: Num[][]

      4x4 projection matrix

    • view: Vec4

      viewport (x, y, width, height)

    Returns Vec3

    Projected 2D coordinates and depth