Creating a 2D game engine in WebGL. Part 1: Matrices and sprite cropping