The first layer, on the top, has one piece. Each new layer has one more piece than the previous one. The loop has 25 frames. In 25 frames each layer must rotate TWO_PI/amount_of_pieces. That’s a full turn for the first layer, 1/2 turn for layer two, 1/3 of a turn for layer three, etc. The colors are selected from a photo.