Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transitionFromFrame #91

Merged
merged 1 commit into from
May 27, 2023
Merged

Add transitionFromFrame #91

merged 1 commit into from
May 27, 2023

Conversation

aleksanb
Copy link
Member

@aleksanb aleksanb commented Apr 9, 2023

I used this a lot during crank, as i keep forgetting the manual implementation of a transition at a certain frame. I guess i could replace the lerp with a clamp.

The name i used for this function in crank was
'interpolateFrame',

Usage:

    const letterGroup1ZPosition = easeIn(
      smoothstep(
        -100,
        0,
        interpolateFrame(frame, fadeDuration, 2489 - fadeDuration)
      ),
      fadeDuration,
      tFadeOut
    );

    const letterGroup2ZPosition = easeIn(
      smoothstep(
        -100,
        0,
        interpolateFrame(frame, fadeDuration, 2524 - fadeDuration)
      ),
      fadeDuration,
      tFadeOut
    );
    const letterGroup3ZPosition = easeIn(
      smoothstep(
        -100,
        0,
        interpolateFrame(frame, fadeDuration, 2560 - fadeDuration)
      ),
      fadeDuration,
      tFadeOut
    );

I used this a lot during crank, as i keep forgetting the manual
implementation of a transition at a certain frame. I guess i could
replace the lerp with a clamp.

The name i used for this function in crank was
'interpolateFrame',

Usage:

```
    const letterGroup1ZPosition = easeIn(
      smoothstep(
        -100,
        0,
        interpolateFrame(frame, fadeDuration, 2489 - fadeDuration)
      ),
      fadeDuration,
      tFadeOut
    );

    const letterGroup2ZPosition = easeIn(
      smoothstep(
        -100,
        0,
        interpolateFrame(frame, fadeDuration, 2524 - fadeDuration)
      ),
      fadeDuration,
      tFadeOut
    );
    const letterGroup3ZPosition = easeIn(
      smoothstep(
        -100,
        0,
        interpolateFrame(frame, fadeDuration, 2560 - fadeDuration)
      ),
      fadeDuration,
      tFadeOut
    );
```
@stianjensen stianjensen merged commit 8c88267 into main May 27, 2023
@stianjensen stianjensen deleted the interpolations branch May 27, 2023 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants