Animating rotation over 360 degrees causes 'jump' #4353
-
Hi! I'm trying to implement a compass, that rotates against the device's heading such that the digital needle always points to north. Since the heading is only polled at around 4Hz it requires some smoothing, which I have done so far with react-native-reanimated, using some simple The problem now is, that the heading, once you turn the phone over the point facing north, will jump from 360° back to 0° (or vice versa) which promptly causes the compass to do a complete 360. My current attempts all involve some way of knowing the interpolated value from the previous frame in order to detect a rotation change of >180° in order to compensate for it, but I have not yet found any way to do so... Does someone have an idea of how to implement such behavior? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey, I'm afraid there's no out-of-the-box solution for this use case, see also #3918 (comment). |
Beta Was this translation helpful? Give feedback.
Hey, I'm afraid there's no out-of-the-box solution for this use case, see also #3918 (comment).