Saturday, February 23, 2008

Thank You Pixelwit!

In the process of concluding that I had to adjust the points along the curve that I was generating based on a magnitude, or ratio, of the relationship between on how close the anchor was to the endpoints of the curve, I stumbled upon Pixelwit's explanation on how Flash's curveTo() function works This filled in some of the math gaps in my brain and I was able to adjust my script based on his sample code. So thanks to Pixelwit for that! The result, available here, shows the points my script generates on top of Flash's curveTo() function. You can see that they're now behaving the same. The number of points along the curve is determined by what I'm referring to as my xDelta, or the minimum x distance between the points along the curve. This is not to be confused with the minimum length of the segments. There are still some kinks to work out before this can be ported over to a usable level editor (as is the ultimate goal of this interface) but this was a big step in the right direction.

No comments: