SamuZai
colortwist
colortwist

patreon


Frayed rope effects

So I'm a bit ashamed to admit I kinda fell down a massive rabbit hole with this one.

Why? Probably because I found it interesting on some level, though one could argue the absurdity of spending more than a couple of days trying to figure out what is a very simple visual mechanic for only a single render (though I suppose it is a reusable workflow, so it might get used in some future stuff as well).

The rabbit hole in this case has to do with frayed rope effects, or more specifically- handling rope fraying around a centralized "cut point", as if a rope were only holding on by a single strand. This effect can be achieved fairly easily by hand, if you're willing to push a few vertices around- but doing things manually means you can't easily tweak the effect without rebuilding all the geometry from scratch.

Since I'm me and I prefer to keep things as procedural as possible (read: having the computer do all the hard work for me), I wanted to try and figure out a way to handle this as dynamically as possible. This mainly involved solving two specific problems:

1) Generating a helical sweep of multiple strands rotated along a common path

2) Figuring out how to bend specific regions of each strand in order to simulate the visual appearance of fraying

The first can be solved using the built-in tools of most modern day 3D packages.

The second is slightly more complicated.

Most 3D programs include "bend" deformers these days, and those work fairly well for what they do. The only problem with them is how they work. Most of them operate by distorting the local space of a 3D model, effectively repositioning all the vertices that fall within a specific "bend region" into their new position (based on the radius and bend angle of the curvature). This works well enough for what it does, but the problem is that the bend region for such deformers is often defined by a pair of 2D planes that extend out into infinity. That means that if you want to bend something like the single arm of a U shaped piece of geometry, you need some way of restricting the bend deformer to that arm only- otherwise the other side of the U shape will be affected as well. Some packages let you restrict deformers like this, others don't. For the most part, even if you can restrict the geometry that your deformer is operating on- doing so just means you're painting (or otherwise managing) vertex weights somehow, which can often become a time consuming process unto itself.

So what you REALLY need is a way to define a path that starts and stops at a specific point, but then bend that path along a region defined by a percentage-along-path instead. That is to say, if I have a line, and I want to bend it between 75% and 80% along that line, then that is where the bend should occur and nowhere else. How that line might be shaped or curved before the 75% mark is inconsequential. The only thing that matters is how the curvature is applied between 75% and 80%, as well as shifting the remaining portion of the line from 80% to 100% to track along with the prior bend.

This is exactly what my little "bend" deformer does.

It takes a 3D path, breaks that down into 1D space, calculates a set of normalized bend weights along one dimension, then remaps that back out into 3D space for the finalized bend effect. This means that the bends applied to any path are totally isolated and will not affect other parts of the same path, even if that path forms some sort of overlapping shape (like a C, U, or S).

There's also some additional logic in there for controlling how the shared bend axis is calculated for spiral paths and offsetting the bend axis if required.

The end results are shown above. The first animation is of the raw bend deformer itself, operating on a straight line of points with a varying bend radius. The second has a twist pre-applied to it, so you can see how the bend deformer automatically tracks along with that twist. The third shows how this works in 3D space along an arbitrary path, which is what is truly required to implement rope fraying effects. The viewport screenshots (non-animated) are from an isolated test scene and an upcoming render that I've been working on, which is actually why I started working on this in the first place.

Anyways, yeah. Cut rope effects. Simple, but also not.

Frayed rope effects Frayed rope effects Frayed rope effects Frayed rope effects Frayed rope effects Frayed rope effects Frayed rope effects

More Creators