fix perspective projection bugs