// Calculate the difference between viewplane and zone width. float xFit = m_zone.Boundary.width / m_viewPlane.width; float yFit = m_zone.Boundary.height / m_viewPlane.height; // Apply to the existing z-pos of the camera. if (m_zone.Fit == FitMode.FitHorizontal) z = position.z * xFit; else if (m_zone.Fit == FitMode.FitVertical) z = position.z * yFit;
And would you believe, I figured it out all out by myself?! The demo is up. Please forward all gold stars of achievement to my postal address.