See: http://www.cnblogs.com/Pointer/archive/2004/12/20/79323.html
Recently, by studying the raster process of the Fixed rendering pipeline, I finally understood the cause of the distortion.
Let's first set V = the vertex before the projection transformation, V '= the Qi vertex after the projection transformation.
In the screen space, the properties of V are not linear, but 1/VZ is linear, other vertex attributes, such as VB and VZ, are linearly distributed. (Mathematics for 3D game programming & Computer Graphics provides detailed proof ), therefore, we should first perform linear interpolation on 1/VZ during interpolation, and then perform linear interpolation on VB/VZ, at last, multiply the interpolation result of VB/VZ by the reciprocal of the interpolation result of 1/VZ to obtain the interpolation result of VB.
Because v'w =-VZ (derivation of projection matrix), we generally use 1/V' W to replace 1/VZ.
During Texture projection, the homogeneous vertex coordinates after projection transformation are projected into three-dimensional space (that is, <v 'x/V' W, V 'y/V' W, V 'z/V' W>), and then use glvertex3f to pass the coordinates to the Fixed rendering pipeline, in this way, the interpolation of texture coordinates is changed from non-linear interpolation to linear interpolation, resulting in distortion of the final result.
In fact, if you directly use glvertex4f to pass V' into the Fixed rendering pipeline and use the Fixed rendering pipeline for perspective correction, this distortion can be eliminated.