Skip to content

Orthographic projection in mat4 is slightly wrong and needs to be updated. #38

@liamegan

Description

@liamegan

Should be:


    const lr = 1 / (right - left),
      bt = 1 / (top - bottom),
      nf = 1 / (far - near);

    return new Mat4(
      2 * lr,
      0,
      0,
      0,

      0,
      2 * bt,
      0,
      0,

      0,
      0,
      -2 * nf,
      0,

      -(right + left) * lr,
      -(top + bottom) * bt,
      -(far + near) * nf,
      1
    );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions