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.
juillet 8th, 2008 at 21 h 04 min
le résultat des filtres est quand même plus smooth !
Tu l’as testé en AS3 ? ça tourne ptete mieux qu’en AS2
juillet 9th, 2008 at 9 h 50 min
le resutlat des filtres est plus smooth mais il n’est pas exploitable… celui la si.
juillet 9th, 2008 at 10 h 17 min
Dooh ! Je vois que tu penses toujours à moi ^^
Greeeat job soldier !
juillet 16th, 2008 at 10 h 52 min
bien joué monsieur crabe
sinatra > +1
la couche de rendu est indépendante du calcul mathématique.
pour le hulling, il existe des sources ( en AS2 :/) qui présentent 4 méthodes: http://www.lostinactionscript.co...
juillet 16th, 2008 at 11 h 15 min
Merci Nicoptere,
effectivement dans l’algo java que j’avais recupéré il y avait 2 méthodes, je n’ai gardé que la plus rapide