Rich asked:
Why does line 85 compute min-max, but line 86 computes max-min?
Because the native PC screen pixel addressing has the origin in the upper left, but "max" and "min" are relative to a lower left origin. Since we want the per_inch values to be positive and since the xx and yy values are in native pixel addresses (even though "max" and "min" refer to a lower left origin), in the x direction we need to subtract min from max to get positive, but in the y direction "max" (e.g. higher) is smaller since it is measured from the top of the screen. Hence to get a positive value we must subtract max from min. What you have here is a sneaky equivocation :-) You need to watch out because the origin-in-the-upper-left convention is probably ubiquitous, and I'm guessing your virtual window pixel addresses are different. Tim
In jb.c, there is this code:
80: xoffsetfp = (xxmax + xxmin) / 2; /* Calculate average */ 81: yoffsetfp = (yymax + yymin) / 2; /* Calculate average */ 82: dmxfp = (mxmaxfp - mxminfp) / zdots; 83: dmyfp = (mymaxfp - myminfp) / zdots; 84: floatparm = &jbcfp; 85: x_per_inchfp = (xxmin - xxmax) / widthfp; 86: y_per_inchfp = (yymax - yymin) / heightfp; 87: inch_per_xdotfp = widthfp / xdots; 88: inch_per_ydotfp = heightfp / ydots;
Why does line 85 compute min-max, but line 86 computes max-min?
This is in routine JulibrotSetup. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html>
Legalize Adulthood! <http://blogs.xmission.com/legalize/>
_______________________________________________ Fractdev mailing list Fractdev@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/fractdev