AS3 Bezier blobs/metaballs
Par Arthy, mardi 8 juillet 2008 à 19:39 :: Labo :: #39 :: rss
My latest AS3 investigation using the graphics & mathematics capabilities of Flash player.
Here is an algorithm i had in mind for a long time, but no time to realise.
I had experienced blobs by using flash filters, but they use so much cpu that i thought about a way to do them with bezier curves.
The main idea is :
- gather many points into blobs
- find the hull (or perimeter) of each blob
- draw the hull with bezier curves
The first difficulty was to find some piece of code that will build the hull (or perimeter) of a couple of points.
I found a java code here : http://www.cs.princeton.edu/~ah/alg_anim/version2/QuickHull.html
Once the code was adapted (you can see blobs points linked by black lines in exmaple), i worked on a way to render the hull with bezier points.
I found a trick to create a larger hull built of many points that will be used for the bezier curves. The result is not as fine as i thought but i guess it's ok.
So here is an example which consists of 50 points :
sorry not so much comments in code, but i think the whole thing is a bit hard. I may isolate the hull algorithm is some of you are interested in.
Commentaires
1. Le mardi 8 juillet 2008 à 21:04, par Thomas
2. Le mercredi 9 juillet 2008 à 09:50, par Franck Sinatra
3. Le mercredi 9 juillet 2008 à 10:17, par dotmick
4. Le mercredi 16 juillet 2008 à 10:52, par nicoptere
5. Le mercredi 16 juillet 2008 à 11:15, par Arthy
Ajouter un commentaire