56.1 Moving, rotating, and scaling
Choose absolute endpoints or changes relative to the current state.
procedure
(move-to target destination) → move-to-request?
target : (or/c visual? symbol?) destination : vec2?
procedure
(move-to-request? value) → boolean?
value : any/c
procedure
(move-along-path target path [ #:start start #:end end #:normal-offset normal-offset]) → move-along-path-request? target : (or/c visual? symbol?) path : (or/c path-geometry? path-visual? derived-visual? symbol?) start : (real-in 0 1) = 0 end : (real-in 0 1) = 1 normal-offset : finite-real? = 0
normal-offset adds a signed displacement perpendicular to the selected route point. A positive value lies to the left of the actual traversal direction; reverse traversal therefore reverses the normal. Zero preserves the route point exactly and does not require tangent sampling. On a sharp polyline corner the offset is segment-local, so the offset trajectory can jump between the adjacent offset edge lines. Smooth cubic routes give smooth normal motion wherever their tangent is continuous.
When path is a path-geometry? value, its points are interpreted directly in target’s containing coordinate system. When it is a path Visual, derived Visual definition, or symbol identity, scene-play resolves the current top-level Visual from the prepared clip-start state by stable identity. A derived definition is evaluated against that exact state first; the concrete result must be a path Visual. The path Visual’s current affine transform is then applied to its local path points before the resulting world-space route is measured. Passing an earlier Visual value therefore selects the current scene value rather than capturing stale coordinates.
The compiled route is a snapshot for that play clip. Simultaneously moving, scaling, rotating, or morphing the path Visual does not dynamically deform the motion route. A path Visual route is world-space after resolution and cannot be used to drive a frame-space target. Raw path geometry may drive a frame-space target because it is already interpreted in that target’s containing coordinate system.
Motion requires a positive finite route with exactly one positive-length subpath. Compound drawings with multiple positive-length subpaths are valid path geometry but are rejected here so the target cannot silently teleport across a gap. Closed single-subpath routes are allowed, including their implicit closing edge.
The request changes the ordinary translation animation component. It conflicts with same-target move-to or another move-along-path, but may run with disjoint rotation, scale, opacity, path-geometry, formula-part, and camera components. Sampling places the target at the selected route point plus any requested normal offset even when its prior reference position differs; put the target at that complete start position before the clip when a continuous clip boundary is required.
procedure
(move-along-path-request? value) → boolean?
value : any/c
procedure
(orient-along-path target path [ #:start start #:end end #:rotation-offset rotation-offset]) → orient-along-path-request? target : (or/c visual? symbol?) path : (or/c path-geometry? path-visual? derived-visual? symbol?) start : (real-in 0 1) = 0 end : (real-in 0 1) = 1 rotation-offset : finite-real? = 0
Path source resolution, clip-start snapshot semantics, transformed path Visual handling, frame/world coordinate rules, positive finite length requirements, and single-positive-subpath continuity requirements are the same as for move-along-path. Tangents are provided by path-geometry-tangent-at.
The request changes only the ordinary rotation animation component. It may run simultaneously with same-target move-along-path, scale, opacity, and disjoint components, but conflicts with same-target rotate-to, rotate-by, or another orient-along-path. The rotation at a sample is derived directly from the sampled tangent rather than interpolated between endpoint angles, so bends and curved routes are followed geometrically.
procedure
(orient-along-path-request? value) → boolean?
value : any/c
procedure
(rotate-to target angle) → rotate-to-request?
target : (or/c visual? symbol?) angle : finite-real?
procedure
(rotate-to-request? value) → boolean?
value : any/c
procedure
(rotate-by target delta) → rotate-by-request?
target : (or/c visual? symbol?) delta : finite-real?
procedure
(rotate-by-request? value) → boolean?
value : any/c
procedure
(scale-to target scale) → scale-to-request?
target : (or/c visual? symbol?) scale : scale-factor?
A built-in group accepts only a uniform endpoint. scene-play rejects a request whose normalized x and y factors differ. For every affine target, compilation also checks that visual-with-scale returns an affine Visual, preserves identity, and installs the requested endpoint exactly. These checks occur before timeline sampling.
procedure
(scale-to-request? value) → boolean?
value : any/c
procedure
(scale-by target factor) → scale-by-request?
target : (or/c visual? symbol?) factor : scale-factor?
For a built-in group, the computed endpoint must remain uniform. scene-play rejects a relative factor that produces unequal x and y components. For every affine target, compilation checks the resulting endpoint through the same visual-with-scale protocol rules as scale-to.
procedure
(scale-by-request? value) → boolean?
value : any/c
procedure
(apply-affine target map) → apply-affine-request?
target : (or/c visual? symbol? visual-path?) map : affine2?
The target may be a top-level world Visual or an ordinary nested visual-path?. A nested request is rebased through enclosing semantic affine maps so its requested map still has world-coordinate meaning. The enclosing map must be invertible; derived Visuals and frame-space overlays are still rejected during scene compilation. The resulting endpoint is an affine-map-visual?, so a later apply-affine composes maps without rasterizing the prior result. Existing movement, rotation, and scale requests conflict with apply-affine for the same target during an overlapping interval.
procedure
(apply-affine-request? value) → boolean?
value : any/c
procedure
(apply-matrix target matrix) → apply-affine-request?
target : (or/c visual? symbol? visual-path?) matrix : linear2?
56.1.1 Robust Pointwise Maps
Pointwise mapping is the nonlinear counterpart of affine mapping. It acts on world-space points and samples a path before mapping it, so a line under a nonlinear map becomes a visible curve rather than a chord joining two transformed endpoints. The exact caller Visual is retained at clip time zero. Adaptive refinement checks the deviation of a mapped midpoint from its mapped chord, while a failed map sample can split the result into separate subpaths.