twirl
Turns the middle of the picture about a point, less and less toward the edge of its reach.
tsx
import { Clip, Composition, Track } from "@uberscene/kit";
// twirl: Turns the middle of the picture about a point, less and less toward the edge of its reach.
export default function Video() {
return (
<Composition fps={30} width={640} height={360}>
<Track id="main">
<Clip
id="shot"
src="asset:redCup"
in={18}
out={21}
fit="cover"
effects={[
{
type: "twirl",
radius: 220,
angle: [
{ at: 0.5, value: 0, easing: "easeInOut" },
{ at: 1.5, value: 180 },
],
},
]}
/>
</Track>
</Composition>
);
}The coffee footage is Pixabay videos 209419, 209424, 46989 and 251, under the Pixabay Content License. The maker of the machine in the red cup shot has nothing to do with this project.
Params
Drawn as a shader.
| param | type | default | description |
|---|---|---|---|
angle | number (-3600..3600) | 120 | How far the picture turns at the centre, in degrees clockwise; negative turns it the other way. |
radius | number (0..4000) | 300 | How far from the centre the twirl reaches, in pixels. |
center | [number, number] | [0.5,0.5] | The point the picture turns about, as [x, y] fractions of the frame from the top left. |