Extract shared logic.
Cube with perspective.