The distortion comes from trying to map R^2 onto the surface of the mesh, since they have different curvature, so they only "match" near the origin.<p>But the random-walk algorithm doesn't actually need to happen in R^2; I think it should be relatively straightforward to adapt to walk directly on the mesh.<p>Instead of tracking an "angle", you just need to track the forward tangent vector. And then walk in very small steps using the geodesic walk algorithm, turning the tangent at each point proportional to the derivative and normal at the new location.<p>It will probably be slower, but it means it will be distortion-free, since you're no longer trying to force flat coordinates onto a non-flat surface.<p>Dealing with intersection is more complicated, though - I think you could probably just use an octree structure for acceleration (like the spatial tree in 2D). Since the segments can be each placed (almost) exactly on planar triangle faces, you can just project onto one/both of the segments' containing faces to check for intersection.
I wonder if it'd be worth adding an auto-spin until interacted with, regarding the 3D model at the very bottom of the page. Almost seems like it's not interactive at first. The FPS meter is cool.
This is badass! Very into proc-gen as a starting point for content creation, but I haven't really found much use for proc-gen as a finishing utility. This seems like a great example of that, though! Detailing should be a lot more modular, using this process. I dig it!
There's a great paper from Ryan Schmidt called "Interactive decal compositing with discrete exponential maps" which tackles this exact problem as well. A more modern variant can be found in the "Vector Heat Method" by the authors of geometry-central, Nicholas Sharp and Keenan Crane, which can compute very accurate "log maps".<p>It's really cool to see this running interactively in the web!! Super slick stuff :)
These trajectories must be how an electron would fly within a chaotic electric field. The field acts on the electron from a perpendicular direction, creating the effect of rotating its velocity vector.