question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3D Cube Animation

See original GitHub issue

Is this a bug report, a feature request, or a question?

Question

Hello everyone,

image

I was using https://github.com/zehfernandes/react-native-3dcube-navigation library to make instagram’s story like cube animation but this library doesn’t use FlatList so it has performance issues and also it has some bugs. I thought maybe I can use snap-carousel to implement 3dcube navigation since it looks same as in custom interpolations page.

But when I tried to implement this custom animation. I notice _scrollInterpolator converts -1, 0, 1 to -width, 0, width. So I using “pageX - width” as given below is incorrect. I tried to change them to -1, 0, 1 but I get really weird result.

image

I am new to react native animations. Any help would be appreciated.

  _getTransformsFor = i => {
    let scrollX = this._animatedValue.x;
    let pageX = -width * i;

    let translateX = scrollX.interpolate({
      inputRange: [pageX - width, pageX, pageX + width],
      outputRange: [(-width - 1) / TR_POSITION, 0, (width + 1) / TR_POSITION],
      extrapolate: 'clamp'
    });

    let rotateY = scrollX.interpolate({
      inputRange: [pageX - width, pageX, pageX + width],
      outputRange: ['-60deg', '0deg', '60deg'],
      extrapolate: 'clamp'
    });

    let translateXAfterRotate = scrollX.interpolate({
      inputRange: [pageX - width, pageX, pageX + width],
      inputRange: [
        pageX - width,
        pageX - width + 0.1,
        pageX,
        pageX + width - 0.1,
        pageX + width
      ],
      outputRange: [
        -width - 1,
        (-width - 1) / PESPECTIVE,
        0,
        (width + 1) / PESPECTIVE,
        +width + 1
      ],
      extrapolate: 'clamp'
    });

    let opacity = scrollX.interpolate({
      inputRange: [
        pageX - width,
        pageX - width + 10,
        pageX,
        pageX + width - 250,
        pageX + width
      ],
      outputRange: [0, 0.6, 1, 0.6, 0],
      extrapolate: 'clamp'
    });

    return {
      transform: [
        { perspective: width },
        { translateX },
        { rotateY: rotateY },
        { translateX: translateXAfterRotate }
      ],
      opacity: opacity
    };
  };

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
romeo-baltacommented, Feb 27, 2020
1reaction
ghostcommented, Dec 15, 2019

Do you need to complete this job? I am a 3d-cube fullstack developer. If you hire me I will best

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: khalid aoussarmailto:notifications@github.com Sent: Sunday, December 15, 2019 8:20 PM To: archriss/react-native-snap-carouselmailto:react-native-snap-carousel@noreply.github.com Cc: michele jamesmailto:leewon961018@hotmail.com; Manualmailto:manual@noreply.github.com Subject: Re: [archriss/react-native-snap-carousel] 3D Cube Animation (#518)

hey did any one hava an idea how we can do it with a flatlist

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/archriss/react-native-snap-carousel/issues/518?email_source=notifications&email_token=ANZADAT3JYPCRHSTWGITNN3QYYOJRA5CNFSM4HL43KXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG4X4XY#issuecomment-565804639, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANZADAQGCNK5J2ALA2OE7WTQYYOJRANCNFSM4HL43KXA.

Read more comments on GitHub >

github_iconTop Results From Across the Web

3D Cube Typography Animation in After Effects | Tutorial
8600+ Templates: https://bit.ly/8600AEtemplates - When you're looking for a unique way to create an up to date and modern motion graphics, ...
Read more >
After Effects Tips & Tricks - 3D Cube - YouTube
Hello, guys!In this Quick Tip, we will show you one of the ways to save the same stroke width in 3D Master Animation...
Read more >
3D Cube - After Effects Tutorial - YouTube
After Effects Tips · Text Animations - After Effects Tutorial · 3D Cube Rotating Text Animation in After Effects - No Plugins |...
Read more >
Rotating 3D Cube Text Animation | After Effects Tutorial
In this After Effects Tutorial, I'll show you how to create a rotating 3D cube text animation.First of all, we use the rectangle...
Read more >
Cube 3D animation - GeoGebra
Cube 3D animation. Author: Cristina Ciocan, Jiří Vančura. Topic: Cube. GeoGebra Applet Press Enter to start activity ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found