matrix: fix missed negation on one component of ortho
This commit is contained in:
parent
b23c274742
commit
c2a880c290
20
matrix.cpp
20
matrix.cpp
@ -133,19 +133,19 @@ matrix<Rows,Cols,T>::is_affine (void) const
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
template <typename T>
|
template <typename T>
|
||||||
util::matrix4<T>
|
util::matrix4<T>
|
||||||
util::ortho (T left, T right,
|
util::ortho (T l, T r, // left, right
|
||||||
T bottom, T top,
|
T b, T t, // bottom, top
|
||||||
T near, T far)
|
T n, T f) // near, far
|
||||||
{
|
{
|
||||||
CHECK_GT (far, near);
|
CHECK_GT (f, n);
|
||||||
|
|
||||||
T tx = - (right + left) / (right - left);
|
T tx = - (r + l) / (r - l);
|
||||||
T ty = - (top + bottom) / (top - bottom);
|
T ty = - (t + b) / (t - b);
|
||||||
T tz = - (far + near) / (far - near);
|
T tz = - (f + n) / (f - n);
|
||||||
|
|
||||||
T rl = 2 / (right - left);
|
T rl = 2 / (r - l);
|
||||||
T tb = 2 / (top - bottom);
|
T tb = 2 / (t - b);
|
||||||
T fn = 2 / (far - near);
|
T fn = -2 / (f - n);
|
||||||
|
|
||||||
return {{
|
return {{
|
||||||
{ rl, 0, 0, tx },
|
{ rl, 0, 0, tx },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user