Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7852543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:26:53+00:00 2026-06-02T19:26:53+00:00

If we use CADisplayLink to set a timer, either at 60fps, 30fps, or 15fps,

  • 0

If we use CADisplayLink to set a timer, either at 60fps, 30fps, or 15fps, and we use the Accelerometer’s

acceleration.x

to handle acceleration, then 60fps will create twice the acceleration as 30fps, because now the object’s x position is updated twice as frequently. How can this be correctly handle for realistic acceleration? (probably to simulate a real gravity pull).


Update: I think I made a mistake: it is not the fps for CADisplayLink, but it is the frequency of the Accelerometer’s event handler. If I set it to 1 / 60.0 or 1 / 30.0, or 1 / 15.0, the object accelerates slower… due to the event handler does a

objVelocity.x += acceleration.x;

I thought the frequency should auto adjust to make the velocity increase slower, but it is not?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:26:56+00:00Added an answer on June 2, 2026 at 7:26 pm

    The concept is wrong. the acceleration will be exactly the same even if you could set it to 100 fps. It will not change because the acceleration is constant until motion manager changes it, and that happens based on the update frequency you set in it. Even if it changed you cant just “add” it because thats not how acceleration works. The device will give you the acceleration (gravity included unless you use device motion) at whatever moment you read it at.

    if you want to get velocity you have the time factor which will compensate for the difference in fps. If you want position then things get much more complicated because there will be the noise from the double integration, as well as that you will have to take into consideration that the readings might not change as fast as you expect. According to my experiments you can safely set it to around 70 times a second, but it does change with what device you use (4s or 4 or so on)

    So for reference:

    The accelerometer gives you acceleration, this will always be a single reading which depends on the acceleration of the device at any given time.

    If you integrate the acceleration you get velocity, this is what you seem to be trying to get, the equation is as follows:

    v = u + a * t

    Now here see carefully how to get your total velocity you add to the initial velocity (your previous velocity u) the new one which is the acceleration multiplied by the time (the acceleration is the reading from the accelerometer, and the time is the time interval between readings).

    For example:

    Your object starts from no movement, acceleratin should read 0 (unless you are using bare accelerometer and not motion manager in which case you will see gravity). now you make it move rapidly to the right and the device takes 5 readings with .2 secs of diff each.

    so you get lets say 1 2 1 -1 -2 … that is because at first it accelerates but when it starts slowing down it is deaccelerating but still, just consider the first reading, your velocity at that time is 0 * 1*.2, now at time to is .2 + 2 * .2 etc etc. Ideally all the velocity from when it started moving to when it finished moving should sum up to 0 because of the laws of motion.

    Now if you happen to want to get the displacement, THAT is super complicated to get accurately, because for it you have to integrate again, and a double integration is madness in terms of error.

    there are several ways to get the displacement, In fact i remember a couple of posts here in stack overflow which discuss how you can get it using the device accelerometer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering, can I use a CADisplayLink Timer instead of an NSTimer even
Use Case When a user goes to my website, they will be confronted with
USE master GO DECLARE @DbName nvarchar(MAX) SET @DbName = N'DataBase' ALTER DATABASE @DbName SET
use pthread_create to create limited number of threads running concurrently Successfully compile and run
Use a hidden field will fix my issue... i got it.. Hi All, I
Use: The user searches for a partial postcode such as 'RG20' which should then
USE [Fk_Test2] GO /****** Object: Table [dbo].[Owners] Script Date: 08/20/2010 16:52:44 ******/ SET ANSI_NULLS
Use case: user clicks the link on a webpage - boom! load of files
use LWP::Simple; use Parallel::ForkManager; @links=( [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-windows.exe,SweetHome3D-2.1-windows.exe], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-macosx.dmg,SweetHome3D-2.1-macosx.dmg], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3DViewer-2.1.zip,SweetHome3DViewer-2.1.zip], ); # Max 30 processes for
use this website a lot but first time posting. My program creates a number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.