A TimeSensor that is set to loop at 10s cycleInterval drives the presentation. It is used to start, at each cycleTime, a TimeSensor of 5s duration with loop of false. The 5s TimeSensor is used to drive the rotation (ScalarInterpolator routed to rotationAngle of each Transform2D that positions each Rectangle). So for 5s the Rectangles rotate and then they are still for 5s.
Initially the center field, of each of the four Transforms2D's positioning the Rectangles, is set so that each Rectangle will rotate about the point that is positioned on the screen's mid-point. This is the first rotation seen. The upper left and lower right rectangles (red, green) rotate in an anti-clockwise direction, while the upper right and lower left (yellow, blue) rotate clockwise.
To change the center the isActive of the 5s TimeSensor is routed to the reverseActivate of a conditional. The conditional will thus execute at the end of 5s when the TimeSensor goes inactive (isActive is false). The conditional contains four replace field commands to set the center field of each Transform2D to 0,0. It also contains a command to replace the route from the TimeSensors isActive to that conditional to a second conditional.
Now at 10s when the second rotation starts the Rectangles rotate about their own midpoints. This lasts for 5s and then the isActive going false activates the second conditional. This restores the values in the center fields to their original values and replaces the route from isActive back to the first conditional. This when the next rotation starts it is the same as the first time; so that the total effect is that the rotation alters between two patterns over a period of 20s where each rotation lasts for 5s and then a gap of 5s before the next.
Snapshot of the four rectangles in unrotated state
![]() |
Snapshot taken during rotation about screen mid-point
![]() |
Snapshot taken during rotation about each rectangles mid-point
![]() |