From the Super Mario Wiki
Super Mario Sunshine
Rotating Panels appear in Super Mario Sunshine in Bianco Hills' secret mission, "The Secret of the Dirty Lake". Here, they are large wooden panels with red and blue borders, which alternate between the red and blue panels flipping, and move in a fixed path.
Super Mario 3D World
Rotating Panels return in Super Mario 3D World in World Star-2, Super Galaxy. They are now smaller and have a more technological appearance, and do not move from their positions. They have the same alternate-flipping function, but now, they make up the majority of the level, and even form long pathways. When rotating, their sides will light up.