| 17 | |
| 18 | @define |
| 19 | class MyAnimation(DepthScene): |
| 20 | animation: Literal["circle", "zoom"] = "circle" |
| 21 | |
| 22 | def update(self) -> None: |
| 23 | if self.animation == "circle": |
| 24 | self.state.isometric = 0.60 |
| 25 | self.state.steady = 0.30 |
| 26 | self.state.offset = ( |
| 27 | 0.5 * math.sin(self.cycle + math.pi/2.0), |
| 28 | 0.5 * math.sin(self.cycle), |
| 29 | ) |
| 30 | |
| 31 | elif self.animation == "zoom": |
| 32 | self.state.height = 0.8 * (math.sin(self.cycle/2.0)**2.0) |
| 33 | |
| 34 | |
| 35 | def main(): |