Welcome to mirror list, hosted at ThFree Co, Russian Federation.

coordinates.cpp « graphics - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 13981e60bb4baa1590edce601918b0ddcd64a070 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "coordinates.hpp"

namespace graphics
{
  void getOrthoMatrix(math::Matrix<float, 4, 4> & m,
                      float l,
                      float r,
                      float b,
                      float t,
                      float n,
                      float f)
  {
    m(0, 0) = 2 / (r - l); m(0, 1) = 0;          m(0, 2) = 0;            m(0, 3) = -(r + l) / (r - l);
    m(1, 0) = 0;           m(1, 1) = 2 / (t - b);m(1, 2) = 0;            m(1, 3) = -(t + b) / (t - b);
    m(2, 0) = 0;           m(2, 1) = 0;          m(2, 2) = -2 / (f - n);  m(2, 3) = (f + n) / (f - n);
    m(3, 0) = 0;           m(3, 1) = 0;          m(3, 2) = 0;            m(3, 3) = 1;
  }
}