February 8, 2019

Flatlander WebGL & the 4th Dimension

Experiments with THREE.js

“Flatland: A Romance of Many Dimensions” is a novella by Edwin Abbott, published in 1884. The story describes a two-dimensional world occupied by geometric polygons. A square dreams about a visit to a one-dimensional world (Lineland) inhabited by “lustrous points”.

The points cannot see the square as anything other than points on a line. The square is later visited by a three-dimensional sphere. The square is unable to see the sphere as anything other than a circle. The sphere then levitates up and down through the Flatland, allowing square to see the circle expand and retract. The square is not fully convinced until he sees Spaceland (a 3d world) for himself. After the sphere shows the square, he tries to convince the sphere of the theoretical possibility of the existence of a fourth (and fifth, and sixth …) spatial dimension; but the sphere returns his student to Flatland in disgrace.

So, how do we visualise all of this?  We code it, of course.  I had been wanting to learn THREE.js for a while so this was a perfect excuse.

The result?  FlatCoder FlatLand (click the link or the image below to open in a new browser window, your browser must support WebGL for this to work!).