Raycaster displays phantom perpendicular wall faces
问题 The output looks like this: You should just see a flat, continuous red wall on one side, blue wall on another, green on another, yellow on another (see the definition of the map, testMapTiles , it's just a map with four walls). Yet there are these phantom wall faces of varying height, which are perpendicular to the real walls. Why? Note that the white "gaps" aren't actually gaps: it's trying to draw a wall of height Infinity (distance 0). If you specifically account for it (this version of