Nicely done, you beat me (or my motivation? :D) to it!
One thing though, the cube itself rotates but the camera does not. It'd be nice if that was possible too (since, use this in a larger project, you'd likely need to do that).
@programmeruser There's a great resource on view matrices (or rather, all of 3D rendering in general) somewhere, but unfortunately I can't seem to find it again. The only thing I can say is that view matrices are actually not very complex, despite what it may seem, so if you can find a good tutorial it'll be very beneficial.