It’s easy to romanticize medieval artists, but it’s important to remember that these are differences in style and technique, and not necessarily because the medieval mind was more "childlike" or open to a certain viewpoint or less developed.

Linear perspective was not discovered until the early 15th century, by an architect named Filippo Brunelleschi. It is linear perspective that creates the illusion of three dimensionality in a flat surface like a canvas. You can see this technique being developed over a number of years in visual art, from the stumbling application in early Renaissance art to its perfection in later Renaissance painting.