How to make an object visible only inside a rectangle

Look here: