Imagine a world where you could sculpt amazing 3D art not with a mouse or brush, but with simple lines of code. A place where complex shapes and scenes came to life right in your web browser, all built from pure mathematics.
Years ago, a fascinating project called Bauble appeared, promising to make this creative vision a reality. It was a unique experiment that brought together high-level programming and advanced graphics techniques, letting people play with digital art in a way few had seen before.
The Strange
Story of Bauble: Art from Pure Math
Bauble was a special tool designed for making 3D art in your browser. It used a technique called raymarching signed distance functions (SDFs). Think of SDFs as a way to describe 3D shapes using math formulas, almost like creating 3D vector art.
These SDFs are very common in the world of procedural art, where artists generate visuals using algorithms. With SDFs, you can create incredible scenes and objects, but usually, it means writing very technical, low-level code that is hard to understand.
Beyond the Pixels: What Are Signed Distance Functions?
Signed Distance Functions are a clever way to define a shape. Instead of drawing every point, you write a function that tells you how far any given point in space is from the surface of your object. If the point is inside the object, the distance is negative. If it’s outside, it’s positive.
This mathematical trick allows for incredibly smooth and complex shapes. You can combine different SDFs to make new forms, subtract one shape from another, or blend them together. It opens up a whole new universe of creative possibilities for digital artists.
"I wanted to play with SDFs, but I found it very frustrating to translate 'I want to rotate this' into 'okay, that means I have to construct a rotation matrix, and then apply it to the current point, and *then
- evaluate the shape...'"
This quote captures the main problem Bauble aimed to solve. The underlying math for SDFs is powerful, but actually using it in traditional coding environments was a huge hurdle for many creative minds. It required deep knowledge of graphics programming that most artists simply didn't have.
Lisp in Your Browser: The Code That Built Worlds
To make SDFs easier to use, Bauble introduced a high-level programming language. It used a specific kind of Lisp called Janet DSL. Lisp is known for being very flexible and good at handling complex ideas with simple code.
This choice of language was key. Instead of struggling with matrices and low-level commands, artists could write simpler instructions like "rotate this shape" or "combine these two objects." The Janet DSL then took these easy-to-understand commands and turned them into the complicated code needed for the browser to draw the 3D art.
Simplifying Complex Graphics
The goal was to remove the frustration. Imagine wanting to rotate a cube. In a traditional setup, you might need to write several lines of code that deal with mathematical matrices. With Bauble, you could express that idea in a much more direct and human-readable way.