More on Beziers, Point Reduction and Curve Fitting

The question is, how can I make my polyline look good and more curvy without that many points. Or better yet, how do I create a bezier curve after I draw my polyline?

Well, take a look

http://www.youtube.com/watch?v=v63NAzQE7Bw

The video shows two algorithms, a variant of the Douglas-Peucker polygon point reduction algorithm and Philip J Schneider’s CurveFit algorithm from Graphic Gems I with material from Philip’s book Geometric Tools for Computer Graphics, as well as material from Mark de Berg Computational Geometry and lastly, Gerald Farin’s Curves and Surfaces for CADG 5th Edition.

I will post the source with comments soon. Who wants it?

Edit: Here is a cleaned up version of the code running on the iPhone. http://developer.anscamobile.com/assets/curvefitting.mp4

Carlos

twitter.com/carlosicaza
[import]uid: 24 topic_id: 4732 reply_id: 304732[/import]

Thanks for this Carlos, it sounds like the logic behind it is just crazy lol

Should come in handy for those building off of the Martian Control codebase or similar projects.

P.S. I LOVE the light blue “trail path” lines (shown at 1:13 in the video). It’s very Flight Control-ey and will come in handy for A LOT of projects! [import]uid: 7849 topic_id: 4732 reply_id: 15084[/import]

All I gotta say is that, this is SWEEEEET!!! [import]uid: 8192 topic_id: 4732 reply_id: 15120[/import]

Hi Carlos,

Where is the source code of this nice demo!
Como que quedo en el ovido despues de las fiestas Navideñas… o tiene que ver con derechos de autor de tus fuentes de inspiracion?

Saludos,

Emilio [import]uid: 9975 topic_id: 4732 reply_id: 17274[/import]

@eaguirre : El codigo lo tengo pero esta sin ninguna optimization y tambien esta super obsfuscado, parece un plato de espagetti mal hecho.

Lo estoy limpiando, pero tengo varios sources disponibles en el ‘code exchange’ de nosotros sobre bezier, pero el de curvefitting no lo tengo todavia pues como te dije esta que es un nudo de globales y dificil de entender.

Tambien tengo que optimizarlo pues hay ciertas condicicones matematicas que pueden ser optimizadas para que performe super bien en mobil.

carlos [import]uid: 24 topic_id: 4732 reply_id: 17290[/import]

Gracias Carlos por tus comentarios.
Esperare la version optimizada.

Saludos,

Emilio [import]uid: 9975 topic_id: 4732 reply_id: 17314[/import]

It would be excellent if physic body can be added to the bezier curve [import]uid: 12088 topic_id: 4732 reply_id: 25883[/import]

This is very nice Carlos!

Where can one find the source for this?

Thanks,

Willy J.
[import]uid: 66859 topic_id: 4732 reply_id: 40143[/import]

Look in the code exchange for the bezier code and also for the Catmull Spline curve fitting.

C [import]uid: 24 topic_id: 4732 reply_id: 40156[/import]

Thanks for the quick reply Carlos! Are these the two you are referring to:

http://developer.anscamobile.com/code/bezier-curves-corona

http://developer.anscamobile.com/code/curve-fitting-catmull-spline

Thanks for your help!

Willy J.
[import]uid: 66859 topic_id: 4732 reply_id: 40162[/import]

yes [import]uid: 24 topic_id: 4732 reply_id: 40163[/import]

Thanks for your help! I look forward to diving into 'em.

Willy J.
[import]uid: 66859 topic_id: 4732 reply_id: 40165[/import]