The wife of 15th-century Italian artist Paolo Uccello used to beg him to come to bed. She was fed up of him staying up all night drawing objects with the new method of 3D illusion – or as it was called at the time, "perspective". He still wouldn't come to bed. "This perspective is such a sweet thing," he said.

Uccello's obsession lives again in the street art of Leon Keer. At a recent chalk art festival, this Dutch artist drew a meticulously planned picture of a "terracotta army" of Lego figures on a street in Sarasota, Florida. After the ethereal white outlines were filled in with earth-coloured paints, it looked as if an army of Lego people (based on China's famous terracotta warriors) had been excavated by archaeologists right in the middle of this American town. The hole and the outsized toys look three-dimensional and solid – if you are standing in the right position.

Photographs of the work show that from the "wrong" position, the picture looks smeared and distorted, a brown blur. Only when you stand at the correct viewing point is the illusion perfect, and then it is very convincing indeed. The first chalk design, seen from this viewpoint, seemed to float in mid-air above the road. Finished, the painting seems to go down into the ground in a hole made in the street.

How does it work? It relies on exactly the same calculations that fascinated Uccello and his contemporaries in Renaissance Florence. If you decide on the viewing point of a picture – the place where the observer stands or sits – you can then plot how everything in that person's view will recede and elongate as it gets further away. The simple fact that further objects seem smaller can be used to create an illusory world if you plan the relative proportions of everything in your picture on a grid like the one Keer drew on to the street.

Lots of trick effects arise from this principle. Hans Holbein's painting The Ambassadors is meant to be looked at from a few feet in front – except for one object that just seems to be a black-and-white smear from this angle but is actually a skull, best viewed from a point to the right of the painting and very close to its surface plane.

Another trick is trompe l'oeil decoration, where you paint a fake window or sculpture high on a building so that it seems real from the ground. Ceiling paintings that seem to depict entire crowds of heavenly beings sitting on clouds use the same methods. So does this amazing street picture.

Computers enable artists to calculate such effects with new precision – just as they enable 3D film-makers to achieve similar illusions. But all these modern wonders go back to the Renaissance when the closest thing to a computer was a set-square. The science improves. The locations change from churches and palaces to cinema screens and street surfaces. Our capacity for wonder lives on.

British artist Joe Hill's creation has broken records for the longest and largest surface area 3D painting, according to Guinness Book of World Records. We take a look at some other great examples of 3D street paintings, from crevasses in Ireland to shark-infested waters in China