Projection

A 4×4 matrix for 3D projective transformations.

Description

A 4x4 matrix used for 3D projective transformations. It can represent transformations such as translation, rotation, scaling, shearing, and perspective division. It consists of four Vector4 columns.

For purely linear transformations (translation, rotation, and scale), it is recommended to use Transform3D, as it is more performant and requires less memory.

Used internally as Camera3D's projection matrix.

Note

There are notable differences when using this API with C#. See C# API differences to GDScript for more information.

Properties

Vector4

w

Vector4(0, 0, 0, 1)

Vector4

x

Vector4(1, 0, 0, 0)

Vector4

y

Vector4(0, 1, 0, 0)

Vector4

z

Vector4(0, 0, 1, 0)

Constructors

Projection

Projection ( )

Projection

Projection ( Projection from )

Projection

Projection ( Transform3D from )

Projection

Projection ( Vector4 x_axis, Vector4 y_axis, Vector4 z_axis, Vector4 w_axis )

Methods

Projection

create_depth_correction ( bool flip_y ) static

Projection

create_fit_aabb ( AABB aabb ) static

Projection

create_for_hmd ( int eye, float aspect, float intraocular_dist, float display_width, float display_to_lens, float oversample, float z_near, float z_far ) static

Projection

create_frustum ( float left, float right, float bottom, float top, float z_near, float z_far ) static

Projection

create_frustum_aspect ( float size, float aspect, Vector2 offset, float z_near, float z_far, bool flip_fov=false ) static

Projection

create_light_atlas_rect ( Rect2 rect ) static

Projection

create_orthogonal ( float left, float right, float bottom, float top, float z_near, float z_far ) static

Projection

create_orthogonal_aspect ( float size, float aspect, float z_near, float z_far, bool flip_fov=false ) static

Projection

create_perspective ( float fovy, float aspect, float z_near, float z_far, bool flip_fov=false ) static

Projection

create_perspective_hmd ( float fovy, float aspect, float z_near, float z_far, bool flip_fov, int eye, float intraocular_dist, float convergence_dist ) static

float

determinant ( ) const

Projection