Motion detection of iOS device in 3d Space - ios

Ive been working with the iOS sensors a bit off late and i wanted to write an app that would accurately track the motion of the phone in space. I wanted to know if its possible to track the motion of the device and detect gestures, such as drawing a circle with your phone or even moving in a straight line.
I've been searching online about this, and i wanted to know two things:-
1.Is it possible to do this with the CoreMotion framework.
2.If Yes, what is the alternative for older devices that do not support CoreMotion. Without the double integral method using the accelerometer!
This would really help!
Any other alternative ideas are most welcome!
Thanks in advance!

As your write, you cannot do the double integral.
For gesture recognition, I would try dynamic time warping. See my earlier answer here.

Related

How to use CMDeviceMotion to detect how fast my device is traveling?

I am writing an iOS app and don't want to start detecting for shake events until after my device has reached a certain speed. I know how to use CMMotionManager to get the CMAccelerationData to detect for shake events but does anyone know what i should use to detect how fast my device is moving? Either CMDeviceMoting/userAcceleration/GPS... i am just cannot find what i should do. I am writing my app in swift but answers in Objective-C will suffice as well.
Thank you for your help
You could use CoreLocation and use a CLLocation's speed property. This requires the device's GPS, and will only work for somewhat large speeds.

How to duplicating perspective zoom home screen feature in iOS?

As we all know, iOS 8 having a perspective zoom feature in the home screen which zooms depend on the angle of a device and how it moves.
I want to duplicate that feature inside my app. I found a question to find out the angle of a device here.
How can I determine the angle of the device?
Measuring tilt angle with CMMotionManager
I need to discuss the ideas to zoom the image depend on the angle of a device. Any help would be appreciated.
Edit: It is a duplicate of this question: iOS 7 parallax effect in my view controller
Thanks for you help.
That feature is called a 'parallax effect' and there is built-in support in Cocoa Touch for it. You don't need to re-invent the wheel to add that effect to your apps. Search the web for information on UIInterpolatingMotionEffect. Here, in particular, is Apple's brief documentation on it.

Is there a way to calculate small distances with CoreMotion?

Is it possible to calculate small distances with CoreMotion?
For example a user moves his iOS device up or down, left and right and facing the device in front of him (landscape).
EDIT
Link as promised...
https://www.youtube.com/watch?v=C7JQ7Rpwn2k position stuff starts at about 23 minutes in.
His summary...
The best thing to do is to try and not use position in your app.
There is a video that I will find to show you. But short answer... No. The margin for error is too great and the integration that you have to do (twice) just amplifies this error.
At best you will end up with the device telling you it is slowly moving in one direction all the time.
At worst it could think it's hurtling around the planet.
2020 Update
So, iOS has added the measure app that does what the OP wanted. And uses a combination of accelerometer and gyroscope and magnetometer in the phone along with ARKit to get the external reference that I was talking about in this answer.
Iā€™m not 100% certain but if you wanted to do something like the OP was asking you should be able to dig into ARKit and find some apis in there that do what you want.
šŸ‘šŸ»

Head movement detection - iOS

Someone asked me if is it possible to detect the head movement of someone using the iPhone's camera. It's because that the person wants to detect when his head touches some random objects falling from above.
This game represents almost what I'm trying to say. Is it possible to use the camera to detect someone's head movement or other part of the body to avoid the ball touching the ground? Not using your fingers over the screen, or the movement of the device.
Do you think it could possible? Because I haven't see any app / game using someone's movement. And if is possible in iOS... would it be possible to do it on Android?
Thanks in advance.
Have a look at this Apple demo code, it's pretty close to what you're after:
http://developer.apple.com/library/ios/#samplecode/SquareCam/Introduction/Intro.html

How to zoom a circular region with Cocos2d?

I am working on a Cocos2d project for iPad and iPhone, and now I need to develop something that looks too small for iPhone.
My first approach was to redesign it to make it possible to look bigger, but then I though that a region zoom effect would be great. The bad point is that I don't know how to do it... I really don't know what would be the correct/best approach to do it.
I have already checked out the Cocos2D CCLens3D build in effect, but it doesn't give me the results I want.
I would love to get the same result than when you long-press a textview/textfield on the UIKit:
Thanks in advance for your help!
If your still looking for a solution:
http://rombosblog.wordpress.com/2012/06/03/magnifierglassforcocos2d/
Uses CoreGraphics to render. Although this implementation works (requires some tweaking), I found that it lacked that Gaussian distribution effect I was looking for and was quite expensive if you updated the magnifying effect in a small interval.

Resources