Hacker News new | past | comments | ask | show | jobs | submit login

The midpoint reflection is an interesting way to compute the next frame, I haven’t seen this before. When I’ve implemented rotation minimizing frames, I used a less tricky version: project the previous frame normal & binormal onto the next tangent plane, then renormalize. A friend called this “poor man’s Bishop frames”. (Used in production on some CG movies you may have seen.)

My projection method fails when the tangent turns more than 90 degrees, of course, so adaptive sampling of the curve is required for the general case. I assume that adaptive sampling is still required for the method presented here? Are there some advantages to mirroring around the midpoint’s tangent plane?

It is worth noting that for the Quadratic Bézier curve, the Frenet Frame is a rotation minimizing frame. Frenet & RMF only differ for cubics and higher.

This guide is excellent, BTW, I refer to it all the time. Thank you!




Quite welcome!

Getting a tangent to change that drastically over a small interval is quite hard, except on a cusp, where the curve itself is discontinuous (so anything that happens at the cusp is always going to be wrong). Of course, cusps only occur in planar curves, but you _could_ still run into that. Splitting the curve at the cusp and treating it as two curves, to be joined "however is the most aesthetically pleasing way" is basically your only option.

A shift and renomalization is a very efficient RMF, but can lead to weird things when the projected binormal ends up lying in the plane of curvature. Say, a curve that starts off going up and left/right, then changes direction from left/right to front/back. If we're not framing on small enough intervals, the binormal of a frame on one side of that change projected to the other side of that change will suddenly lie in the plane of curvature, and renormalisation can suddenly be broken.


> Getting a tangent to change that drastically over a small interval is quite hard, except on a cusp, where the curve itself is discontinuous (so anything that happens at the cusp is always going to be wrong)

FWIW, I ran into near cusps with 3D curves immediately in production with hair physics simulations. They don’t happen a lot, but the frames are needed for guide hairs, so popping when frames flip is extremely noticeable, even though they not crazy common.

> Splitting the curve at the cusp and treating it as two curves, to be joined "however is the most aesthetically pleasing way" is basically your only option.

I came up with an adaptive sampling method that can guarantee a step size with no more than a given minimum change of angle. It worked well in my case for CG hair with cubics. (Not published, but happy to describe if you have any interest.)

I’ve also seen a really neat parametric remapping method for quadratics that can precompute all parameter values with an exact constant change of angle for every step.


As long as you have near-cusps rather than real cusps (and to be fair: real planar cusps in 3D are easily avoid by just forcing planar curves to be non-planar during your pre-render pass) simply drastically decreasing the sampling interval over low-radius-of-curvature sections is a perfectly valid approach. It's fast (ish =D) and gets the job done.


I tried much smaller steps, and it never got me there with a reasonable step size. It was a lot less expensive to do adaptive sampling than crank up the step size. Plus, you already know, there’s no guarantee with regular sampling. Near cusps can be arbitrarily small. Production wanted a guarantee, even if things were to run slower. I think adaptive was faster, but their primary concern was to know they wouldn’t have surprises or have to call in support once there were hundreds of hair shots in the pipe.

The other advantage of maximum angle sampling is when calculating arc length of a curve with piecewise approximation.

Anyway, It’s entirely possible that seeing as many very near cusps as we did was because our physics simulation was under constrained or not very good. ;) But for whatever reason, my experience left me with the feeling that they’re common enough to be a serious concern, rather than rare and easily avoidable...


Absolutely, when dollars are on the line, the procedure is always 1: make it work. 2: make it fast. 3: make it nice and write a paper on it. And while step 2 is sometimes optional, step 3 _always_ is =)

If you run into cusps a lot on a hair simulation, that feels like evidence of a bad model, but plenty of good things have been done with bad models so that's hardly an indictment on the process. If your model yields loads of cusps, you need a solution, and this type of RMF is probably a very expensive solution.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: