Hello!
I was just reviewing the Handmade Hero code and came across something that has me confused. If you take a look at handmade_world_mode.cpp (line 682), you will notice a conversion multiplier for MetersToPixels based on the estimated width of the monitor in meters.
real32 WidthOfMonitor = 0.635f; // NOTE(casey): Horizontal measurement of monitor in meters
real32 MetersToPixels = (real32)DrawBuffer->Width*WidthOfMonitor;
It seems that the MetersToPixels calc should actually be the following (assuming we will ignore division by zero protection using SafeRatio):
real32 MetersToPixels = (real32)DrawBuffer->Width / WidthOfMonitor;
Example:
1 meter * ( 1920 pixels / .635 meters ) = 3,023.622 pixels
Whereas the current calculation results in:
1 meter * 1920 pixels * .635 meters = 1,219.2 meters-pixels (units are not cancelling)
I believe the perspective projection works in the current code base because we have the DistanceAboveGround at 9.0f. If you make the above correction, you will need to adjust this to between 20.0f and 25.0f in order to achieve the similar results to the current setup.
Regards