I know zombie stream. You probably already solved this problem, but here are my thoughts years after the fact ...
Since anti-aliasing depends on several points in a row, I think it will be quite difficult to find a anti-aliasing algorithm that looks reasonable without creating some instability in the leading edge. You can probably reduce the instability, but only run the risk of creating a very strange footprint.
The first option would be to use a spline algorithm that limits projection artifacts. For example, the Catmull-Rom algorithm uses two known points on each side of a curve segment, interpolated. You can synthesize two additional points at each end of the curve or simply draw the first segment of the curve as a straight line. This will give a straight line as the last segment plus a curve from the second to the last segment, which should change very little, if at all when adding another point.
Alternatively, you can run the actual data points through the initial spline calculation to multiply the points, and then run these points through the spline algo a second time. You still have to update the last 2m points (where m is the first-pass multiplier), or the result will be distorted.
The only other possibility that I can think of is to try to predict a couple of points ahead based on your previous data, which can be difficult even with fairly regular input. I used this to synthesize Bezier control points for the ends of my curves β I calculated the CP for all points and needed something that could be used for the end points β and had some interesting points trying to stop the end segments of the curve from distorting badly deformed.
Oh, more ... don't draw the final segment of the curve. If you complete your curve at P n-1 , the curve should remain stable. Draw the final segment in a different style, if you should show it at all. Since CR splines require only +/- 2 known interpolation points, the segment P n-2 -P n-1 should be fairly stable.
If you do not have code for the CR algorithm, you can do basically the same with BΓ©zier synthetic control points. Instead of trying to describe the process, check out this blog post , which gives a pretty good breakdown of the process. This article has some code that may be helpful.
Corey
source share