Skip to content
amitp edited this page Sep 13, 2010 · 11 revisions

I haven’t decided how I’m going to represent roads, but it’s very likely that I’ll draw them with quadratic Bezier curves, since that’s what Flash has built in.

This demo shows what roads might look like, and also shows a quadratic bezier curve approximating a circular arc. When the arc angle is less than 1/6th of the circle, the bezier curve seems to be a reasonable approximation, but I may still have to subdivide it to make it match an arc.

On the left the road is represented by two Bezier curves. On the right the road is represented by straight segments and a circular arc joining them. The arcs not only look better, the construction naturally joins segments together; the Bezier curves don’t automatically meet. Before making the demo I had expected the most natural drag handle to be the center of the circle, but while playing around you’ll see that it can go off screen. Instead, the best drag handles are going to be the small yellow dots on the road itself, showing where the transition from straight line to arc occurs.





Clone this wiki locally