I m trying to implement orthographic camera. When I used DirectX, orthographic projection matrix could be determined in some way. An ordinary textured rectangle might be represented as follows:
auto l = -screenWidth / 2 + rectPosition.X;
auto r = l + rectWidth;
auto t = screenHeight / 2 - rectPosition.Y;
auto b = t - rectHeight;
float vx [] =
{
l, t, 0, 1, 0, 0, // x y z w u v
r, b, 0, 1, 1, 1,
l, b, 0, 1, 0, 1,
l, t, 0, 1, 0, 0,
r, t, 0, 1, 1, 0,
r, b, 0, 1, 1, 1,
};
And ortho matrix could be set this way:
ortho(screenWidth,screenHeight,0.1f,1000.f);
I could get visible image by setting camera's projection matrix as ortho matrix without changing camera's update code. So, I think this approach must work. But all I see is black screen. What's to be done?