Glimmr Canvas Animation

version 1/111030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Invocation phrases for motion on coordinates

    [Specify movement by points, duration, and timer.]
    To animate (track - an animation track) as a parameterized motion animation targeting (P - a value of kind K valued property) of (targ - an object) and ending at (end pt - a list of numbers) at (interv - a number) with a/-- duration of/-- (len - a number) frame/frames, cycling:
        let P1 be P converted to a number;
        now the animation-target of the track is targ;
        if targ has property number P1:
            now the property-storage of the track is P1;
            let X be the text which relates to P1 by the property-naming relation;
            now the property-name-storage of the track is X;
        if cycling:
            now the track is cycling;
        otherwise:
            now the track is not cycling;
        let L be a list of numbers;
        let L be list property P of targ;
        now start-x of the track is entry 1 of L;
        now start-y of the track is entry 2 of L;
        now the delta-x of the track is (entry 1 of end pt) - start-x of the track;
        now the delta-y of the track is (entry 2 of end pt) - start-y of the track;
        now the animation-target of the track is targ;
        if the targ provides the property display status:
            now the display status of the targ is g-active;
        now the cycle-length of the track is len;
        set up track as parameterized motion with duration len;
        animate the track at interv[ ms per frame].

    To animate (track - an animation track) as a parameterized motion animation targeting (P - a value of kind K valued property) of (targ - an object) and ending at (end pt - a list of numbers) at (interv - a number) with a/-- velocity of/-- (V - a number) --/unit/units, cycling:
        let P1 be P converted to a number;
        now the animation-target of the track is targ;
        if targ has property number P1:
            now the property-storage of the track is P1;
            let X be the text which relates to P1 by the property-naming relation;
            now the property-name-storage of the track is X;
        if cycling:
            now the track is cycling;
        otherwise:
            now the track is not cycling;
        let L be a list of numbers;
        let L be list property P of targ;
        now start-x of the track is entry 1 of L;
        now start-y of the track is entry 2 of L;
        now the delta-x of the track is (entry 1 of end pt) - start-x of the track;
        now the delta-y of the track is (entry 2 of end pt) - start-y of the track;
        let X be the square root of (delta-x of the track * delta-x of the track) + (delta-y of the track * delta-y of the track);
        let len be X / V;
        if len < 1, now len is 1;
        now the animation-target of the track is targ;
        if the targ provides the property display status:
            now the display status of the targ is g-active;
        now the cycle-length of the track is len;
        set up track as parameterized motion with duration len;
        animate the track at interv[ ms per frame].