Draw Smoother Lines

I have created a game where the player draws a line and an object follows that line.

The issue is that the line is pretty jaggedy and unsmooth, I’d like a smooth line similar to these air traffic control games you see where you draw the plane’s paths.

I am aware of the catmull algorithm, and have attempted to implement the sample code found here:
http://developer.anscamobile.com/code/curve-fitting-catmull-spline

It was a little unsuccessful due to the complexity of my code and the way I generate the array of points. Had anyone had any luck doing it any other ways? [import]uid: 62042 topic_id: 15965 reply_id: 315965[/import]

reduce the number of points using douglas pucker algorithm also found on code exchange.

also, take a look at flight demo template - it uses the DP algorithm and catmull splines.

  • when doing curve fitting make sure you reduce the number of points.

also see my notes and books on curve fitting at

www.carlosicaza.com

c. [import]uid: 24 topic_id: 15965 reply_id: 59130[/import]

Hi,
Carlos we are working on a game using Bezier path. The user draws a line on the screen and the object (follows the path and reaches the end).

The game works great on the Simulator but while testing it as an .apk file on the device it gives an error “Application Corrupted” and it does not move ahead.

We are using build .591 to build and test. Will the catmull spline be a solution?.
[import]uid: 56933 topic_id: 15965 reply_id: 59132[/import]

The game works great on the Simulator but while testing it as an .apk file on the device it gives an error “Application Corrupted” and it does not move ahead.

Do you have an arm7 device?

sounds to me like you don’t have a CoronaSDK supported device.

Must be ARMv7

C. [import]uid: 24 topic_id: 15965 reply_id: 59135[/import]

Hi,
It is Armv7 device Samsun Galaxy SLCD GT-I9003 running Froyo Android 2.2.

Also strangely the other bezier tutorial which has been adapted in Hungry Fish game is working, but this one does not.

[import]uid: 56933 topic_id: 15965 reply_id: 59137[/import]

i don’t know why it would not work -

any light you can shed? can you use logcat and see what it tells you?

C
[import]uid: 24 topic_id: 15965 reply_id: 59140[/import]

Actually we are using the Flight path code posted at GitHub. Just now we again downloaded the source files and made an .apk from it.

While running it again shows the same message “Error. This application has been corrupted.”.
[import]uid: 56933 topic_id: 15965 reply_id: 59141[/import]