Adding perspective projection handling