This is a recreation of Gorillaz Andromeda music video in WebGL. It mimics same visuals and effects in the music video by rendering whole scene on desktop and mobile browsers.
Three.js is awesome 3D library that I play with since it came out. Building little experiments, playing with shaders etc are always fun. So I decided to build a 3D fancy video player for my portfolio posts. Isn’t it better than static images?
It has a simple scene. I added bunch of randomised triangles in the background. Set their colors to dominant colors of the given project. In the center I added a simple plane with a video texture on it.
I’ll share the source after I revise it a bit.
I’m not an illustrator but this would be cool poster on a brick wall. The idea is to mimic the hand drawings programmatically.
The key is drawing an imperfect circle. Faces you see here are combination of many imperfect circles. There is almost no linear path but combination of segmented, circles. I used Two.js(I’m a big fan of Three.js too.) to draw curvy paths. It’s an awesome little JS gem.
Here is the code that draw circles:
var randomize = function(value,rand)
return value += Math.random()*rand - (rand*0.5);
var getCurveyCircle = function(startAngle,endAngle,radiusX,radiusY,segments,rand)
var anchors = ;
for(var i=0; i<=segments; i++)
var step = startAngle + (i * (endAngle-startAngle)/segments);
var px = Math.cos(step/180*Math.PI)*radiusX + randomize(0,rand);
var py = Math.sin(step/180*Math.PI)*radiusY + randomize(0,rand);
anchors.push(new Two.Anchor(px, py));
First we create segmented circle. Then we randomise positions of these segment points a little. And finally we make curvy path using these points.
var circle = getCurveyCircle(0,360,100,100,20,5);
To mimic hand draw we draw two rounds of circles on top of each other:
var circle = getCurveyCircle(0,720,100,100,20,5);
As you can see this looks like a hand drawn two rounds of circles. Head, eyes, ears, eyebrows and mouth are all combinations of the same technique and yet every face is unique and sketchy.
First I needed a way to mark the parts of the image so that I can understand which parts are more detailed (like eyes, mouth etc.). Next step is a bit easy. After I get the marks, I use Delaunay triangulation algorithm to draw triangles.
This is the marker I wrote:
First I create a grid over the original image. Every rectangle in this grid compares its average colour to colour of every pixel in the rectangle. If a pixel colour is too distant from the average colour, that pixel is marked. If marked pixel count is larger than given threshold, whole rectangle is marked and is divided by 4 and every divided rectangle repeats same steps recursively.
Back in when I was in high school I was always into drawing by code. This was one of my first attempts. This little brusher, draws 200 lines and their line widths depend on the speed of mouse and their colours are based on their positions on a real photo. This was originally written in AS3(remember that golden area of glorious Flash?). Source is here.