Switch perspective transformation to a matrix

Added compensation for aspect ratio