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

Tilt & Hold Position? Or Tilt to Pan? #2

Open
jtkeyva opened this issue Sep 18, 2023 · 5 comments
Open

Tilt & Hold Position? Or Tilt to Pan? #2

jtkeyva opened this issue Sep 18, 2023 · 5 comments
Labels
a: await investigate The issue is waiting for further investigation c: question Further information is requested

Comments

@jtkeyva
Copy link

jtkeyva commented Sep 18, 2023

Hi, wondering if it's possible that when you tilt and keep it tilted that the position stays until you tilt it back to origin? This could be fun to be able to peek behind things or pan around a widget.

It has been implemented on the Motion Package
mrcendre/motion#8

@AmosHuKe
Copy link
Member

Hi~ @jtkeyva
You can try changing the enableSensorRevert and enableRevert of TiltConfig.
It's like this:

Tilt(
  tiltConfig: const TiltConfig(
    enableRevert: false,
    enableSensorRevert: false,
  ),
),

@AmosHuKe AmosHuKe added the c: question Further information is requested label Sep 18, 2023
@jtkeyva
Copy link
Author

jtkeyva commented Sep 19, 2023

@AmosHuKe thanks, it works pretty good!

i did some experimenting and some tests and found that if i move it around enough it "tricks" it and doesn't recalibrate to it's origin.

i set my phone at an angle on the desk propped up on my laptop and started the app. i picked up my phone to look at it and set it back down where it was and it remembered the origin pretty good.

but if i move the phone around a bit, it loses track of the the origin.

is there any way to have high precision using this? i suppose it would be kinda like AR but with no lidar. So i could have widgets off screen and then pan over to see them. is that doable?

Also, what about spinning the phone around from portrait to landscape and retaining the orientation of the content? so essentially you could spin your phone and just reveal more parts of the content.

thank you, this is cool :)

@AmosHuKe AmosHuKe added the c: bug Something isn't working label Sep 19, 2023
@AmosHuKe
Copy link
Member

@jtkeyva, Thanks for your use and suggestions!

Just released version 2.0.3
Fixed the device landscape mode not matching the sensor orientation.

I don't have a particularly good idea for positioning like AR at the moment, but I will continue to evaluate and test this effect.

@jtkeyva
Copy link
Author

jtkeyva commented Sep 19, 2023

@AmosHuKe great to hear!

This package somehow seems to use AR without actually using AR as far as I can tell. I poked around and it seems like it uses the compass and sensors only?

https://pub.dev/packages/ar_location_view

Maybe you can get some ideas/inspiration from it :)

I look forward to your thoughts

@jtkeyva
Copy link
Author

jtkeyva commented Sep 19, 2023

Cool it works well when I use it like:

void main() {
runApp(MyApp());
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
}

It still doesn't perfectly remember the origin position when disabling revert. Not sure if that's possible? Maybe you can have an option to "set origin"? That way you can always return to the true position when it was set?

@AmosHuKe AmosHuKe added the a: await investigate The issue is waiting for further investigation label Sep 20, 2023
@AmosHuKe AmosHuKe removed the c: bug Something isn't working label Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: await investigate The issue is waiting for further investigation c: question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants