Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 10-01-2008, 04:44 PM   #1 (permalink)
scotopia
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 1,650
Default Refining the motion of a ball's movement based on accelerometer

Hello All,

I have found a good tutorial on the subject of making a ball move based on the accelerometer:

Exploring iPhone Graphics Part 3 | Trails in the Sand

but the motion of the ball does not look nearly as smooth as other apps I have seen (Labyrinth is the best example).

I suspect there are all sorts of smoothing algorithms and the like involved. Now that the NDA is lifted I would like us all to put our heads together to make a really nice core engine for object motion based on the iphones tilt.

To get a truly accurate scenario we would I imagine have to be constantly doing something like this with each tick of the accelerometer:

1) get the ball's current velocity and break it into its component vectors along the axes (that's plural of axis right? )
2) get the current accelerometer values over the last time interval
3) break that acceleration into it's component vectors along the axes
4) apply this acceleration to get the new velocity along the axes
5) add these component vectors to get the ball's new velocity and movement on the screen

Does this sound about right?

Here are some links to get us thinking in the right place:

Equations of motion - Wikipedia, the free encyclopedia
Classical mechanics - Wikipedia, the free encyclopedia

Eventually I would like to go even further to get some simplistic but accurate physics going on for collisions and the like, but first things first.

Let's see what we can come up with. Thanks!
scotopia is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,050
Threads: 38,834
Posts: 170,357
Top Poster: smasher (2,561)
Welcome to our newest member, Giulio_b
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:52 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.