AS3 – Blurred Camera AS3 8BitBoy in Flash 9 IDE
juil 08

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 :

Sources are available here

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.

5 Responses to “AS3 Bezier blobs/metaballs”

  1. Thomas Says:

    le résultat des filtres est quand même plus smooth !

    Tu l’as testé en AS3 ? ça tourne ptete mieux qu’en AS2

  2. Franck Sinatra Says:

    le resutlat des filtres est plus smooth mais il n’est pas exploitable… celui la si.

  3. dotmick Says:

    Dooh ! Je vois que tu penses toujours à moi ^^

    Greeeat job soldier !

  4. nicoptere Says:

    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...

  5. Arthy Says:

    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 :)

Leave a Reply

IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)

What is 6 + 6 ?
Please leave these two fields as-is: