I needed a sketch in order to work out some maths. Given each vertical line is indexed by 0, 10, 20, 30, 40... from left to right in world coordinates, what is the formula that determines the distance in pixels from the left edge to that line? Parameters are: width of screen in pixels. Screen X coord of first fencepost. X distance between first and second fenceposts in pixels. height and width of each rectangle in world coordinates. (10x10) Screen X,Y coordinate of horizon. Top and bottom Y coordinates of first fencepost in pixels.
The code is awful, it's just a sketch to help me think about how to implement the general solution. NEXT: https://scratch.mit.edu/projects/158370759/ Eventually for use in a maze or Doom type 3D environment. Is it easier to determine two vanishing points and work with those rather than the usual world coordinate to screen coordinate projective mapping?