New Site Page - Webcloth
An interactive new toy on my site
Published on Wednesday, July 30, 2025

Today I've added a new page to my site! It is an interactive cloth simulation written in almost pure WebGL which you can control and mess around with.
You can access it right here, or inside the projects page. Controls are provided below the simulation window. (As of writing there are only Keyboard and Mouse Controls).
Note that this requires Javascript and WebGL to run. So basically any modern browser will do.
I originally made this as part of a assignment a few months ago. After many afternoons and weekends, I was able to create this simulation basically from scratch using just what I had learned and by doing lots of research on previous implementations. Overall, I think it ended up pretty good for having only spent bits of time for a few weeks on it.
A lot of the stuff, such as selecting points on the cloth and the floor, were already made. But the cloth's behavior, including how it swings around and its collision behavior, was all manually programmed in that period.
While it isn't the most optimized application, I did add some features that let it run faster (namely a specialized structure that sped up the cloth's self-collision detection). It works well on my machines, but they are pretty beefy which is why I set the default resolution here to a relatively low value.
Feel free to toy around with the tool! And break it, of course.