Implement perspective transform