Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 30, 2013, 03:43 PM   #1
Chirone
macrumors 6502
 
Join Date: Mar 2009
Location: NZ
spin a wheel and have it slow down and dampen

Hi, I have a view that I want to spin on the z axis and if you swipe your finger fast enough it should continue to spin and slow down, much like the scroll views do.

I'm having a lot of trouble trying to figure it out. I've seen some people do it before but the result they get isn't really all that good. Like, the view spins like it should only if you swipe in a particular direction.

All I've successfully been able to do is have the view rotate for a set time and set angle. I don't know how to calculate the time and angle based on the speed of the finger.
Chirone is offline   0 Reply With Quote
Old Jan 30, 2013, 07:57 PM   #2
PhoneyDeveloper
macrumors 68030
 
PhoneyDeveloper's Avatar
 
Join Date: Sep 2008
Look up "ease in ease out."
PhoneyDeveloper is offline   0 Reply With Quote
Old Jan 30, 2013, 09:01 PM   #3
Chirone
Thread Starter
macrumors 6502
 
Join Date: Mar 2009
Location: NZ
That will make it slow down as it stops yes, but it's not the solution I'm looking for.
It relies on me already knowing the start and end angles and the duration. The last two of which I don't know as mentioned in the last sentence of my first post
Chirone is offline   0 Reply With Quote
Old Jan 31, 2013, 05:14 AM   #4
MattInOz
macrumors 68030
 
MattInOz's Avatar
 
Join Date: Jan 2006
Location: Sydney
Wwdc session advanced scroll view showed how to use a scrollview to act as the the gesture recognized. Using its delegate methods and the like to provide the sort info you want then apply that data to an OpenGL scene at frame rate.

Might be worth a look.
__________________
There is no such thing as "Collective Wisdom"
[ iPhone 5s, iPad Mini, 13" MacBookPro 2.7Ghz, 27"Al iMac i7, Black MacBook 13"]
MattInOz is offline   0 Reply With Quote
Old Jan 31, 2013, 06:49 AM   #5
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Quote:
Originally Posted by Chirone View Post
That will make it slow down as it stops yes, but it's not the solution I'm looking for.
It relies on me already knowing the start and end angles and the duration. The last two of which I don't know as mentioned in the last sentence of my first post
Shouldn't you be able to calculate (and so know very quickly afterwards) those two variables as soon as the user picks up their finger?
ArtOfWarfare is offline   0 Reply With Quote
Old Jan 31, 2013, 01:55 PM   #6
Chirone
Thread Starter
macrumors 6502
 
Join Date: Mar 2009
Location: NZ
Quote:
Originally Posted by MattInOz View Post
Wwdc session advanced scroll view showed how to use a scrollview to act as the the gesture recognized. Using its delegate methods and the like to provide the sort info you want then apply that data to an OpenGL scene at frame rate.

Might be worth a look.
Which year was that?

Quote:
Originally Posted by ArtOfWarfare View Post
Shouldn't you be able to calculate (and so know very quickly afterwards) those two variables as soon as the user picks up their finger?
Sure can! But I don't know how to calculate it...
Chirone is offline   0 Reply With Quote
Old Jan 31, 2013, 02:00 PM   #7
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Quote:
Originally Posted by Chirone View Post
Which year was that?


Sure can! But I don't know how to calculate it...
Well, you have the current speed and (I assume) a constant deceleration, so calculating the time it should come to a stop isn't hard. The position it'll be at that time can be found by taking the initial speed, dividing by 2, and multiplying by that end time.
ArtOfWarfare is offline   0 Reply With Quote
Old Jan 31, 2013, 02:19 PM   #8
MattInOz
macrumors 68030
 
MattInOz's Avatar
 
Join Date: Jan 2006
Location: Sydney
Quote:
Originally Posted by Chirone View Post
Which year was that?


Sure can! But I don't know how to calculate it...
2012. Session 223 enhancing user experience with scroll views
__________________
There is no such thing as "Collective Wisdom"
[ iPhone 5s, iPad Mini, 13" MacBookPro 2.7Ghz, 27"Al iMac i7, Black MacBook 13"]
MattInOz is offline   0 Reply With Quote
Old Jan 31, 2013, 02:47 PM   #9
Chirone
Thread Starter
macrumors 6502
 
Join Date: Mar 2009
Location: NZ
Quote:
Originally Posted by MattInOz View Post
2012. Session 223 enhancing user experience with scroll views
Cool. Will have a look.

Also, I found this website:
http://gizma.com/easing/

it looks like the formulas should work. But it appears only the ease in and linear ones work. The ease out and ease in and out ones don't.
Since ease in/out never looks different to linear to me I have to plot the values calculated on a graph and the values calculated for ease out are linear.
Chirone is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Will iOS 7 look dampen sales? MeatRocket iOS 7 33 Jun 30, 2013 08:55 PM
Front-wheel or rear-wheel -- does it matter for city driving? kylera Community Discussion 7 Feb 10, 2013 05:54 PM
Slow start-up, running wheel, no Finder, can't copy nor past bekble MacBook Air 3 Jan 30, 2013 02:49 PM
Macbook stuck on spin wheel and grey screen iGotaMac MacBook Pro 6 Nov 16, 2012 07:07 PM
Macbook Pro stuck in spin wheel iGotaMac MacBook Pro 0 Nov 15, 2012 12:56 PM

Forum Jump

All times are GMT -5. The time now is 07:08 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC