Deceleration calculation for moving screen objects

In summary: I would like to be able to scroll an object and allow it to coast to a stop. To do this, I will need to be able to calculate the deceleration over a distance. I am looking into two methods: a fixed stopping distance and a fixed time to reach 0 velocity.
  • #1
BeanAnimal
4
0
Long story short...

I am having a hard time creating natural deceleration for a VB.NET touchscreen project. I would like to be able to scroll an object and allow it to coast to a stop.

The starting velocity will be set by the swipe speed of the finger. Let's call it pixels/millisecond. That leaves me with a DISTANCE and TIME to 0 velocity as unknowns.

My Choices (at least as I see it).

a) Choose a fixed stopping distance (maybe based on the length of the initial swipe) and then calculate the time needed to reach 0 velocity.

-or-

b) Choose a fixed time to reach a 0 velocity and calculate the distance the object will decelerate over. ( I don't like this option at all)..

-or-

c) Give the object a mass and friction, then calculate both the time and distance to reach 0 velocity. (appealing because both mass and friction could be adjustable, even set based on the length and speed of the initial finger swipe. I.E. short swipe = higher friction, longer swipe = lower friction).

I am having trouble applying (and/or understanding) the proper kinametics or inertial formula.

Here is a "Microsoft Touch" information page would be the ideal model for what I am trying to recreate. This MS Touch functionality is not available on the platform I am developing for (not to mention that I would really like to learn how to figure this out on my own the next time).

Thanks in advance,

Bill
 
Last edited:
Physics news on Phys.org
  • #2
what is often used is this (iteratively):
new_speed = old_speed * factor
with
0 < factor < 1
until
old_speed < small_number (object stopped)

it is efficient, and gives similar results to realistic friction (option c). but as with (c) its is harder to control for specific value for deceleration time / distance.

option c) could look like this
new_speed = old_speed - (old_speed ^ 2 * friction_factor * delta_time)/mass
 
  • #3
Is this supposed to mimic the motion of a thrown ball or are you on a 2d flat surface - like an air-hockey table?
Normally you use either a linear acceleration where you just pick an amount of speed to subtract in each time interval and make the object stop when the speed reaches zero - this is good for simple thrown objects.
Or you make the acceleration proportional to the speed, so you reduce the speed to say 0.9 of the previous speed in each time interval - and stop the object when the speed reaches some small value. This looks more realistic for real world objects where there is a lot of drag (friction).
 
  • #4
Wow... fast responses in this forum!

This is supposed to mimic the motion on a 2D surface (like the air hockey table). The idea is to derive the same type of sliding functionality found in modern touchscreen applications like the iPhone, WindowsMobile 6.1, etc. To be more precise, I was unable to find jukebox software that fits my needs, so I am writing my own (VB.NET) and would like to implement the functionality for browsing through cover art, tracks etc. I also don't like being stumped by a problem, so I have set out to learn what I need to know.

I will see if I can setup a simualtion using both methods above.

As for the being stumped...What am I missing with the equation on the MS page? It just does not appear to give me usable results.
 
  • #5
Another tip - don't try and deal with angles. Use the velocity in X and Y separately and use the fractional version ie speed in each time interval is 0.9 (or whatever) the previous one separately in X and Y.
This will even give the correct rebounds from the walls - just flip the sign of the appropriate velocity
 
  • #7
The equation they give is X = Vo t - d t^2
Is normally written as s = ut + 1/2 a t^2
Just says that the distance an object moves 's' is the initial speed 'u' * time it was moving for, minus the deceleration * time *time.
This is true for an object moving at constant acceleration (or decelration) such as a weight falling in vacuum. it isn't true for most everyday cases with friction where the slowing depends on the speed.
For those cases just making the speed in the next second to be eg. 90% of the speed in the previous second looks more real
 
  • #8
Thanks again. I have implemented the advice given:
new_speed = old_speed - (old_speed ^ 2 * friction_factor * delta_time)/mass

It appears to be working very well for my purposes.
 

1. What is deceleration and how is it calculated for moving screen objects?

Deceleration is the rate at which an object's speed decreases. It is calculated by dividing the change in velocity by the change in time. This can be represented by the formula: deceleration = (final velocity - initial velocity) / time.

2. How does deceleration affect the motion of screen objects?

Deceleration causes screen objects to slow down or come to a stop. This can be seen in animations or games where objects gradually decrease in speed as they approach their destination.

3. What factors can influence deceleration for moving screen objects?

The main factors that can influence deceleration for moving screen objects include the object's mass, the force acting on it, and any external factors like friction or air resistance. Additionally, the initial speed and direction of the object can also impact its deceleration.

4. How can deceleration be used to enhance user experience in games or animations?

Deceleration can be used to create more realistic and immersive experiences for users. By accurately calculating the deceleration of screen objects, movements can look more natural and fluid, making the overall experience more enjoyable for users.

5. Are there any limitations or challenges when calculating deceleration for moving screen objects?

One of the main challenges in calculating deceleration for moving screen objects is taking into account the various external factors that can influence it. Additionally, the accuracy of deceleration calculations may also be affected by the precision of the measurements and the complexity of the motion of the screen objects.

Similar threads

Replies
1
Views
1K
Replies
11
Views
1K
Replies
19
Views
3K
Replies
2
Views
10K
  • Mechanics
Replies
6
Views
906
  • Mechanics
Replies
9
Views
1K
Replies
16
Views
9K
Replies
19
Views
1K
  • Mechanics
Replies
11
Views
2K
  • Classical Physics
2
Replies
46
Views
3K
Back
Top