Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Using tilt sensor to simulate gravity
Forum Updated to NodeBB v4.3 + New Features

Using tilt sensor to simulate gravity

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 269 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nykson
    wrote on last edited by
    #1

    I want to add a little gimick to my app.
    I'm trying to put a bar at the top of my gui and within this bar there is a image of a ball.
    Depending on how you tilt your phone the image of the ball should either go to the right or left.
    To give you a better understanding of what I mean, here some pictures:
    Screenshot_1.png
    Screenshot_2.png
    Screenshot_3.png
    I've found this but still could not figure out how to do it.
    Does anyone have an idea how to approach such idea.
    Is it even possible?
    Appreciate any help!

    M 1 Reply Last reply
    0
    • N Nykson

      I want to add a little gimick to my app.
      I'm trying to put a bar at the top of my gui and within this bar there is a image of a ball.
      Depending on how you tilt your phone the image of the ball should either go to the right or left.
      To give you a better understanding of what I mean, here some pictures:
      Screenshot_1.png
      Screenshot_2.png
      Screenshot_3.png
      I've found this but still could not figure out how to do it.
      Does anyone have an idea how to approach such idea.
      Is it even possible?
      Appreciate any help!

      M Offline
      M Offline
      mvuori
      wrote on last edited by
      #2

      Check out https://doc.qt.io/qt-6/qtiltreading.html and the docs about sensors in general.

      The link shows the essential: you can read the current tilt. But that is the trivial part. The hard part is programmind the dynamics.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved