3 ms·
I think the way you described it explains the prevalence of 3D for demos. Geometric shapes in 3D can be described in closed form equations requiring a minimum o
by throwaway17_17 3y ago
I think the way you described it explains the prevalence of 3D for demos. Geometric shapes in 3D can be described in closed form equations requiring a minimum of storage, however, the only ‘mathematical’ way to store 2D style animation is as SVG curves for outline and then a space filling algorithm for the coloring of those areas. The curves are, I am making a back of the envelope guess, going to require as much storage for a single arc/line as the description of a geometric volume in total. Then there is the issue of storing the animation of those curves which is going to require even more space, compared to the relatively small transformation matrix for the 3D volume. I would also guess the complexity of the rendering algorithm would increase (both in actual algorithmic and space complexity).
— Caveat: one could argue that storing a series of bitmaps and then playing them back like a flip book could be ‘mathematical’, especially if some procedural uncompressing algorithm was used to generate full frames from on some change differential, but I don’t think that exists and the space requirement would be huge compared to 3D volumetric descriptions.
- nine_k 3y agoI don't see why interesting 2D animation could not be made using closed forms. A rectangle takes 2 parameters for shape, and 2 for position; 3 if you rotate it. Similarly for an ellipse. Realistically you also need a Z-index. The soft-min function mentioned in the post would allow to merge 2D shapes the same way as 3D shapes, at the expense of one additional parameter. An approach similar to the signed depth field and ray marching can be used to determine boundaries, and thus the kind of painting inside. This would require to start a scan line at a position which is guaranteed to be outside of any of the shapes; this must be easy. Texturing would be harder, but, knowing the position inside the shape relative to its center, it would be possible to procedurally generate nice gradients, regular textures like bricks or scales, or noisy textures like fur. Using the same trick with calculating the gradient would allow to create nice thick / styled outlines. Doing this on a CPU would, of course, be pretty slow, so this would need to be written as a bunch of shaders somehow. I don't see why it won't work though: each shader could take one scanline, they would share the same geometric model, and shaders are good at doing a lot of FPU math in parallel.