mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 18:45:36 +00:00
Fixed Perspective implementation.
This commit is contained in:
parent
607c6b23aa
commit
408c66dd5d
|
@ -379,7 +379,7 @@ namespace OpenTK.Math
|
||||||
/// <returns>A projection matrix that transforms camera space to raster space</returns>
|
/// <returns>A projection matrix that transforms camera space to raster space</returns>
|
||||||
public static Matrix4 Perspective(float fovy, float aspect, float near, float far)
|
public static Matrix4 Perspective(float fovy, float aspect, float near, float far)
|
||||||
{
|
{
|
||||||
float yMax = near * (float)System.Math.Tan(fovy);
|
float yMax = near * (float)System.Math.Tan(0.5f * fovy);
|
||||||
float yMin = -yMax;
|
float yMin = -yMax;
|
||||||
float xMin = yMin * aspect;
|
float xMin = yMin * aspect;
|
||||||
float xMax = yMax * aspect;
|
float xMax = yMax * aspect;
|
||||||
|
|
Loading…
Reference in a new issue