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

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!

All I gotta say is that, this is SWEEEEET!!!!!

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

@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

Gracias Carlos por tus comentarios.
Esperare la version optimizada.

Saludos,

Emilio

It would be excellent if physic body can be added to the bezier curve

This is very nice Carlos!

Where can one find the source for this?

Thanks,

Willy J.

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

C

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.

yes

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

Willy J.

views:2115 update:2011/9/19 13:40:57
corona forums © 2003-2011