Rolling Cube

How do I do this, rotate a vector around the edges?