@scene.on_frame runs your function automatically on every rendered frame
dt — the time in seconds since the last frame (delta time)x += speed * dt — multiply by dt for smooth, frame-rate-independent motionon_click(handler) — the handler runs when the mesh is clicked
sphere.on_click(lambda: sphere.set_color('#e94560')) — one-liner with lambdascene.run() — each mesh can have its own independent handlerscene.on_key(key, handler) runs a function each time a key is pressed
Key constants for special keys: Key.LEFT, Key.RIGHT, Key.SPACEscene.on_key('w', move_forward)Group wraps multiple shapes into a single moveable unit
group.add(shape), then add the group with scene.add(group)group.set_rotation(y=45) — rotates every shape inside togetherget_position() → (x, y, z) · get_rotation() → degrees · get_scale() → factorsx, y, z = ball.get_position()Explore the “Animations”, “On Click”, “On Key”, “Grouping”, “Getters”, and “Let’s Experiment” notebooks
Ask for help if you need it!