Some JavaScript Sketches
It’s been a while since a blog post, so here’s a look at some small sketches I’ve developed in the last six months.
Most of them use WebGL and/or WebAudio, and are intended to be viewed on desktop Chrome or FireFox. Not all work on mobile. Each explores a single idea, delivered as a sort of “animated real-time artwork.”
ink
desktop only
(demo) - (source)
This was a small audio-reactive sketch that uses soundcloud-badge by Hugh Kennedy. The original idea was to mimic the flow of black ink on paper, but it quickly diverged as I became more interested in projecting a video texture onto a swarm of 3D particles.
The trick here is just to take the position of the 3D particle and divide by the w component to get its position in screen space. We can use this as our uv
coordinates into the video texture.
// vertex shader
void main() {
// classic MVP vertex position
mat4
...