修正透视矩阵计算X轴方向不对问题

This commit is contained in:
hyzboy 2025-06-18 01:56:20 +08:00
parent c5b37f9835
commit 71b459c024
2 changed files with 2 additions and 2 deletions

View File

@ -110,7 +110,7 @@ namespace hgl
* @param target
* @param up
*/
Matrix4f lookat(const Vector3f &eye,const Vector3f &target,const Vector3f &up);
Matrix4f lookat(const Vector3f &eye,const Vector3f &target,const Vector3f &up=AxisVector::Z);
inline Matrix4f translate(const Vector3f &v)
{

View File

@ -81,7 +81,7 @@ namespace hgl
float f = 1.0f / tanf( deg2rad( 0.5f * field_of_view ) );
return Matrix4f(
f / aspect_ratio,
-f / aspect_ratio,
0.0f,
0.0f,
0.0f,