I'm writing my own 3D engine and I have this matrix to make a perspective look. (It's a standard matrix so there is nothing interesting)
public static Matrix3D PrespectiveFromHV(double fieldOfViewY, double aspectRatio, double zNearPlane, double zFarPlane, double mod)
{
double height = 1.0 / Math.Tan(fieldOfViewY / 2.0);
double width = height / aspectRatio;
double d = zNearPlane - zFarPlane;
var rm = Math.Round(mod, 1);
var m = new Matrix3D(
width, 0, 0, 0,
0, height, 0, 0,
0, 0, (zFarPlane / d) * rm, (zNearPlane * zFarPlane / d) * rm,
0, 0, (-1 * rm), (1 - rm)
);
return m;
}
I could make my scene look 2D like just by ignoring that matrix.
But want to do is to make smooth transition from 3D to 2D and back...
Any one have any idea? What do I have to change in this matrix to make smooth transitions possible?