Colours are pretty poop..
I need to find a better way to do this.
Currently:
For every cube:
1) Get the face it represents from the original model
2) get the middle pixel of that triangle
3) change it like this:
3.1) convert to hsv
3.2) color.v += 2;
3.3) color.v = (color.v - 50) * 1.1 + 50; // make the light colours lighter, the dark colours darker
3.4) color.v = Math.max(0, Math.min(color.v, 100)); // make sure we're still in range
3.5) color.s = Math.sin(1-(Math.abs(color.s-50)/50)) * 120; // increase the saturation of colours that are 'average saturation'
3.6) color.s = Math.min(100, color.s); // put saturation back in range
4) Match the new colour against a colour from a minecraft block
5) Map the new texture onto the cube
|