Selfie Sunday 002 :: Webcam to ASCII
In this Selfie Sunday we learn how to build a patch that turns webcam input into an ASCII display.
It’s a 3 part tutorial – starting with how to push font into a matrix to analyse and sort the brightness of each character to use in the next 2 tutorials.
Part 1 (above):
We start off the tutorial by bringing [jit.gl.text] rendered font into matrix-land and analyse each character, sorting them in order of brightness, and storing them in a matrix table.
Then we learn how to use the sorted character table from Part 1 to generate an ASCII image from webcam input, using [jit.gl.text] embedded in a [poly~] to generate each line of text text.
You’ll need an even spaced font to do this properly – here’s the font “Classic Console“:
And in part 3 we take a different approach, by using the table from Part 1 and learn how to generate a large [jit.gl.texture] that contains all the font characters. We then use the input from the webcam to generate a UV/texture map using [jit.expr], and apply it to a [jit.gl.mesh], dynamically referencing the texture of characters.
Here are the patchers: