2D Metaballs Demo using Marching Squares
04 April 2022
Metaballs are organic looking blob like balls that merge and split
apart based on their distances from each other. They can be defined as a
single function or a summation of functions across the x and y plane. By
computing the contours, a very cool picture can be produced in real time
as shown below. However, computing the entirety of the function plane to
a high degree of precision is very expensive. To make it less expensive
and produce a good high quality contour marching squares can be
used. It samples 4 points of a function and interpolates where a
threshold value occurs to draw the outline. I was inspired by
Reducible’s video on how computers can draw weird shapes.
POV-ray Dice
22 February 2022
I saw a captcha with dice thread on hacker news. The general idea
of the captcha was to find the picture of dice with the right sum on it.
I was wondering how hard it would be to generate several thousand of
these dice images, and how long it would take using POV-ray.
POV-ray is the Persistence of Vision Ray Tracer. It takes a text based
description of the scene built using various primitives like spheres and
boxes to produce a ray traced image. The POV-ray language is Turing
complete and allows some really advanced programming features, such as
macros, loops and conditionals, which I take full advantage of for this
scene. The dice are even transparent.