
As a preface, I fixed the endpoint interpolating issue. The problem was that I was confusing the polynomial order with the degree. As a result of this confusion, I did not use enough redundant knots. Including them has fixed this issue.
I have now turned my attention to the issue of how to round off the boundaries of the spline itself, particularly near the base, left and right sides, where the aurora does not blend convincingly into the background image.
To make the blending more convincing, I have used Gaussian functions to attenuate the alpha channel. Right now, what I am doing is something like
Alpha = 255 * exp(-1 * c^2/(2*q^2) * exp(-16 * t^2)
where c = d / dmax - f, q = .1, f = .4, d is the point distance along the normal direction to the skeleton, and dmax is the result of computing the maximum distance spline function for the parameter value of t (which is also used to compute the spline shape and color).
While these mathematics are crude and convoluted, my point here is to convey the fact that we want the alpha to attenuate according to two factors. First, the alpha should be greatest at some "center" value of t in the range [0, 1]. This will help to make sure the ends of the aurora will not stick out. Second, for the same reason as before, we want the alpha to attenuate from some "center" defined as a fraction of the maximum distance spline function. This way, the aurora maintains the same shape as the skeleton, but eliminates the need to give the base special treatment.
No comments:
Post a Comment