Genuary 14: Impossible

January 14, 2022

This is a sketch for Genuary 2022, which provides a creative coding prompt for each day of January. This is day 14: "Something you’d never make."

I chose to interpret this theme as something one could never manufacture (because the geometry is impossible.)

Although this looks 3D, and indeed it is rendered in WebGL, it works by plotting the points in 2D. Instead of having all the surface normals point outwards like one would normally find on a planar shape, I manually set the normals to what I think they should be at the edge of each face. This lets me use 3D lighting and have it look somewhat like a real 3D shape. WebGL interpolates the normals along the faces, allowing them to bend along a supposedly flat surface.

There is unfortunately a visible seam that gets created along the diagonal of each face. This is because the faces are made of two triangles each. Even though the normals along the diagonal are the same for both triangles, you see a seam because neither face has full knowledge of all four corners of the quad. Interpolation for one triangle works as if the triangle is part of a parallelogram when it may actually be part of a trapezoid. To fix this, I'd need to write a custom shader and a bunch of math, and unfortunately I am too lazy for that right now.