I need to take High Definition Screen shots in my directx(C#) application. and i found out the solution in Game Programming gems2 book, and i implemented it in my application and it is working fine, but the problem is they gave the algorithm for Perspective view , now i need to take same HD screen shots in Orthogonal View...
The idea behind tis is we are splitting the screen into 9 quadrants and set the projection matrix then take screen shots and we get 9 pictures then we are stitching it to one picture, and the below alogorithm values works well for perspective view but it doesnt work for orthogonal view, i need to know the left,right,top,botom values for orthogonal view..!!
void GpgPerspective (double fovy, double aspect, double Near, double
Far, int subrect)
{
double fov2, left, right, bottom, top;
fov2 = GpgDegToRad(fovy) * 0.5;
top = Near/(cos(fov2)/sin(fov2));
bottom = -top;
right = top*aspect;
left = -right;
if (subrect == -1) //Regular full screen
GpgFrustum (left, right, bottom, top, Near, Far);
else if (subrect == 0) //UL
GpgFrustum(left, left/3.0, top/3.0, top, Near, Far);
else if (subrect == 1) //UC
GpgFrustum(left/3.0, right/3.0, top/3.0, top, Near, Far);
else if (subrect == 2) //UR
GpgFrustum(right/3.0, right, top/3.0, top, Near, Far);
else if (subrect == 3) //ML
GpgFrustum(left, left/3.0, bottom/3.0, top/3.0, Near, Far);
else if (subrect == 4) //MC
GpgFrustum(left/3.0, right/3.0, bottom/3.0, top/3.0, Near, Far);
else if (subrect == 5) //MR
GpgFrustum(right/3.0, right, bottom/3.0, top/3.0, Near, Far);
else if (subrect == 6) //BL
GpgFrustum(left, left/3.0, bottom, bottom/3.0, Near, Far);
else if (subrect == 7) //BC
GpgFrustum(left/3.0, right/3.0, bottom, bottom/3.0, Near, Far);
else if (subrect == 8) //BR
GpgFrustum(right/3.0, right, bottom, bottom/3.0, Near, Far);
}
void GpgFrustum (double left, double right, double bottom, double
top, double zNear, double zFar)
{
float matrix[16] = { 1.0f, O.Of, O.Of, O.Of,
0.Of, 1.Of, 0.Of, 0. Of,
O.Of, O.Of, 1.0f, O.Of,
0. Of, 0. Of, 0. Of, 1 . Of } ;
matrix[0] = (float) (2. 0*zNear/ (right-left j) ;
matrix[5] = (float) (2. 0*zNear/ (top-bottom) );
matrix[8] = (float) ((right+left)/(right-left)) ;
matrix[9] = (float) ((top+bottom) /(top-bottom) );
matrix[10] = (float) (-(zFar)/(zFar-zNear)) ;
matrix[11] = (float) (-1 .0) ;
matrix[14] = (float32) (-(zFar*zNear)/(zFar-zNear)) ;
#endif
//Now set this matrix as the current projection matrix
}