Cogl.Matrix.prototype.view_2d_in_perspective

function view_2d_in_perspective(fov_y: Number(gfloat), aspect: Number(gfloat), z_near: Number(gfloat), z_2d: Number(gfloat), width_2d: Number(gfloat), height_2d: Number(gfloat)): void {
    // Gjs wrapper for cogl_matrix_view_2d_in_perspective()
}
  

Multiplies matrix by a view transform that maps the 2D coordinates (0,0) top left and (width_2d,height_2d) bottom right the full viewport size. Geometry at a depth of 0 will now lie on this 2D plane.

Note: this doesn't multiply the matrix by any projection matrix, but it assumes you have a perspective projection as defined by passing the corresponding arguments to Cogl.Matrix.prototype.perspective.

Toolkits such as Clutter that mix 2D and 3D drawing can use this to create a 2D coordinate system within a 3D perspective projected view frustum.

Since 1.8

fov_y

A field of view angle for the Y axis

aspect

The ratio of width to height determining the field of view angle for the x axis.

z_near

The distance to the near clip plane. Never pass 0 and always pass a positive number.

z_2d

The distance to the 2D plane. (Should always be positive and be between z_near and the z_far value that was passed to Cogl.Matrix.prototype.frustum)

width_2d

The width of the 2D coordinate system

height_2d

The height of the 2D coordinate system