Drawing Amoebae Part 2

Now that we have points which move in an amoeba-like pattern we need to be able to draw a smooth and continuous curve through these points so that our amoeba's outline looks realistic. To do this we will use the built in quadratic curve primitives provided by java. A quadratic curve takes three points. A beginning point, an end point, and a control point which will cause the curve to be stretched in its direction. It works exactly the same way as the curved line tool in MS Paint.


For the amoeba, these beginning and end points will not be the nodes themselves, but rather the midpoints between each node. Then we will use each node as a control point stretching the line between each midpoint to it's left and right. In the following picture, nodes are the large circles and midpoints are the small circles.


You can see that the cubic curves become continuous when you use midpoints as the beginning and end points. Using this approach we obtained a very good looking amoeba outline.

No comments:

Post a Comment