Rotating light cube

I was reading a Richard Feynman book the other day about vector maths – as you do – and it occurred to me that RGB colours are effectively 3D vectors and so a palette of colours could be plotted in 3 dimensions – the red, green and blue components of the colour corresponding to the x,y,z coordinates of the cube.

No 3D software or libraries are used to produce this the 3D coordinates are reprojected into 2D using trigonometry and plotted in place on a 2D canvas. At the moment the cube is created as an image using the GDAL PHP library so I’ve got a job to do to re-write this using an HTML5 Canvas instead.