Ken, how did you calculated umost and dmost (the wall edges for every screen column) (for calculating the texture offset)? I first tried to translate the screen points to world pointsfor every screen column but that gave bad results and projecting every point of the wall like a screen column it's a real bad idea. Then I thought at raycasting because a would only have to do one intersection with a single line /column! Leave my ideas away. How did YOU do it?
Awesoken at
Umost and dmost are used only for polygon clipping. Texture coordinates are calculated with separate code. Calculation of texture coordinates is based on standard 3D math: transormation, projection, and the use of Cramer's rule to solve 3 equations with 3 unknowns. For general polygons, it would require a divide per pixel. Walls, ceilings, and non-sloped floors are in fact special cases where you don't need to do a divide per pixel. If you render walls in the vertical direction, and you render (non-sloped) ceilings and floors in the horizontal direction, and the camera is restricted to not tilt or use true look up&down, then the entire line would share the same distance. Since the denominator of the divide is proportional to this distance, it is only necessary to do one divide per line in these cases.