mirror of
https://github.com/opus-tango/IntroductionToVulkan.git
synced 2026-03-20 12:05:20 +00:00
Fixed calculation of projection matrices (aligned with the Vulkan Cookbook).
This commit is contained in:
@@ -108,18 +108,18 @@ namespace ApiWithoutSecrets {
|
|||||||
0.0f,
|
0.0f,
|
||||||
|
|
||||||
0.0f,
|
0.0f,
|
||||||
f,
|
-f,
|
||||||
0.0f,
|
0.0f,
|
||||||
0.0f,
|
0.0f,
|
||||||
|
|
||||||
0.0f,
|
0.0f,
|
||||||
0.0f,
|
0.0f,
|
||||||
(near_clip + far_clip) / (near_clip - far_clip),
|
far_clip / (near_clip - far_clip),
|
||||||
-1.0f,
|
-1.0f,
|
||||||
|
|
||||||
0.0f,
|
0.0f,
|
||||||
0.0f,
|
0.0f,
|
||||||
(2.0f * near_clip * far_clip) / (near_clip - far_clip),
|
(near_clip * far_clip) / (near_clip - far_clip),
|
||||||
0.0f
|
0.0f
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -143,12 +143,12 @@ namespace ApiWithoutSecrets {
|
|||||||
|
|
||||||
0.0f,
|
0.0f,
|
||||||
0.0f,
|
0.0f,
|
||||||
-2.0f / (far_plane - near_plane),
|
1.0f / (near_plane - far_plane),
|
||||||
0.0f,
|
0.0f,
|
||||||
|
|
||||||
-(right_plane + left_plane) / (right_plane - left_plane),
|
-(right_plane + left_plane) / (right_plane - left_plane),
|
||||||
-(bottom_plane + top_plane) / (bottom_plane - top_plane),
|
-(bottom_plane + top_plane) / (bottom_plane - top_plane),
|
||||||
-(far_plane + near_plane) / (far_plane - near_plane),
|
near_plane / (near_plane - far_plane),
|
||||||
1.0f
|
1.0f
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user