Skip to content

Commit

Permalink
use cotangent for rglPerspective not tan
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley committed Feb 19, 2024
1 parent 4bb0cfa commit 3330236
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ void rglRenderBatchWithShader(u32 program, u32 vertexLocation, u32 texCoordLocat
}

void rglPerspective(double fovY, double aspect, double zNear, double zFar) {
const double f = tan(fovY / 2.0);
const double f = 1.0f / tan(fovY / 2.0);
float projectionMatrix[16] = {0};

projectionMatrix[0] = f / aspect;
Expand Down

0 comments on commit 3330236

Please sign in to comment.