Rift: Modifying the Projection / FOV part 1

I’ve attempted to recreate the FOV used by the Rift, by calling CalculateFovFromEyePosition using defaults found in OVR_Stereo.cpp (mostly in OVR_Stereo.cpp::CreateDebugHMDInfo):

 info.ProductName = "Oculus Rift DK2"; 
 info.ResolutionInPixels = Sizei ( 1920, 1080 );
 info.ScreenSizeInMeters = Sizef ( 0.12576f, 0.07074f );
 info.ScreenGapSizeInMeters = 0.0f;
 info.CenterFromTopInMeters = info.ScreenSizeInMeters.h * 0.5f;
 info.LensSeparationInMeters = 0.0635f;
 info.Shutter.Type = HmdShutter_RollingRightToLeft;
 info.Shutter.VsyncToNextVsync = ( 1.0f / 76.0f );
 info.Shutter.VsyncToFirstScanline = 0.0000273f;
 info.Shutter.FirstScanlineToLastScanline = 0.0131033f;
 info.Shutter.PixelSettleTime = 0.0f;
 info.Shutter.PixelPersistence = 0.18f * info.Shutter.VsyncToNextVsync;


 case EyeCup_DKHD2A:
 renderInfo.LensDiameterInMeters = 0.035f;
 renderInfo.LensSurfaceToMidplateInMeters = 0.02357f;
 // Not strictly lens-specific, but still wise to set a reasonable default for relief.
 renderInfo.EyeLeft.ReliefInMeters = 0.010f; 
 renderInfo.EyeRight.ReliefInMeters = 0.010f; 

 renderInfo.EyeLeft.NoseToPupilInMeters = 0.032f; 

const float OVR_DEFAULT_EXTRA_EYE_ROTATION = 30.0f * MATH_FLOAT_DEGREETORADFACTOR;

I expected to reproduce the default FOV, which yields a scene like so:not calling the function

What I see instead is this:calling the function

 

It needs some work.

That work may be probing the values via debugger, as the default FOV is built; or, I could work through the code in that function and decide how things would go awry as displayed above.  Or arguing with include files some more, so I can probe values via code.  (Or, finding some bug in my code that’s doing something dumb.)

But soon that work will have to become bypassing the Oculus SDK as much as possible; it’d be nice to standardize to their system, but it’d be even nicer to actually get this working.