sábado, 27 de abril de 2013

Experiment #4


(Stand still and press any button)


This one was quite fun to do (and so was to watch the final result)! It does, however, require a webcam.

The process is quite simple:
-Flash gets Camera input and attaches it to a Video Object (which then displays)
-Then, when a key is pressed, a new BitmapData object is created, and the current camera image is attached to it.
-Each pixel's perceived brightness is calculated (it's not a very efficient method) through a neat equation I found on the Internet:



-If a pixel's Perceived Brightness is less than 0.35 (mind, a pixel's Perceived Brightness varies from 0, very dark, to 1, very bright), a black pixel with it's coordinates is drawn to the stage.

Source

As usual,

Licença Creative Commons

Experiment #4 by MikeMakesGames is licensed under a Creative Commons Atribuição-Partilha nos termos da mesma licença 3.0 Unported License.