Skip to content

Commit

Permalink
Fix projection matrix formula
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdkon authored and wonder-sk committed Mar 5, 2025
1 parent a3a4957 commit 83d5b0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/3d/qgs3dmapscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void Qgs3DMapScene::updateScene( bool forceUpdate )
float fovRadians = ( camera->fieldOfView() / 2.0f ) * static_cast<float>( M_PI ) / 180.0f;
float fovCotan = std::cos( fovRadians ) / std::sin( fovRadians );
QMatrix4x4 projMatrix(
fovCotan / camera->fieldOfView(), 0, 0, 0,
fovCotan / camera->aspectRatio(), 0, 0, 0,
0, fovCotan, 0, 0,
0, 0, -1, -2,
0, 0, -1, 0
Expand Down

0 comments on commit 83d5b0b

Please sign in to comment.