Matrix helper for WebGL