diff --git a/inc/hgl/math/Matrix.h b/inc/hgl/math/Matrix.h index 5c84df0..4bebb65 100644 --- a/inc/hgl/math/Matrix.h +++ b/inc/hgl/math/Matrix.h @@ -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) { diff --git a/src/Math/Matrix4f.cpp b/src/Math/Matrix4f.cpp index 0fce0a6..92e91bf 100644 --- a/src/Math/Matrix4f.cpp +++ b/src/Math/Matrix4f.cpp @@ -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,