Fix the aspect ratio in the gfx cube example

An aspect ratio of 1.0 does not fit the screen resolution, so the rendered cube looks a bit odd. While fixing this the relation has also been refactored.