How to draw a rectangle that can move and rotate around x,y, z ?

How to draw a rectangle like this: