修正透视矩阵计算X轴方向不对问题
This commit is contained in:
parent
c5b37f9835
commit
71b459c024
@ -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)
|
||||
{
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user