How to detect the circular Gestures on New Siri Remote 2nd Generation - swift

I want to detect the action of rotate the wheel on the new Apple TV Siri Remote 2nd Generation.
Is there a way to know which direction clockwise or anti-clockwise?
How can i get the speed of rotation or any data related to this circular action?

Apple did not announce any new gesture recognizer for this new gesture, but you can implement it by yourself.
To do it you can use the GameController SDK that will allow you to get the absolute location of the user finger in the digitizer. Once you have the coordinates of the gesture location you can apply some trigonometry maths to detect if they are rotating the finger clockwise or anticlockwise.
I wrote a post with further details here:
https://dcordero.me/posts/capture_circular_gestures_on_siri_remote_2nd_generation.html

Related

Controls in SceneKit/SpriteKit?

I need help implementing controls to move a SceneKit sphere. I want to have the user touch on the screen and when they move their finger around, the ball will move relative to the position of the user's finger. I don't want the y to increase or decrease I just want x and z, almost like a hula hoop.
I think you can use the GameController Framework seen Apple have released the WWDC Demo 'Fox', and it use GameController to control the character.

Simulating Multi Touch UIAutomation in Instruments on iOS device

Can someone point me in the right direction for how to simulate a multi touch tap in Instruments?
There are a few functions in which the number of touches is a parameter, but I don't understand how to actually define the coordinates of each touch.
For example, I need to simulate the user holding down a touch (or tap) at coordinate x1,y1 and x2, y2.
The application is not using standard accessible UI objects so I can only use coordinates.
I think the following should represent a held tap at specific coordinates, but it's only a single finger tap.
target.frontMostApp().mainWindow().scrollViews()[0].touchAndHold(1.7);
If you really need a two finger
Try performing a swipe action that doesn't move very far
target.frontMostApp().mainWindow().tableViews()[1].cells()[2].dragInsideWithOptions({startOffset:{x:0.0, y:0.1}, endOffset:{x:0.5, y:0.1}, duration:0.25});

How to detect a moving object and its position in camera in iOS?

I want to detect movement of an object in iOS camera. Actually I am working on a project where the iOS camera is placed some where and when it detects any movement on the camera screen then it gives notification or fire any particular event.
Please suggest if how can I achieve the same.

iPhone - detecting circle movements

I have an area where the user can draw using a finger. This area contains an object that I want the user to be able to rotate it clockwise or anti-clockwise. My idea is to offer the user the whole screen to control the object. I mean, if the user starts to describe clock wise finger movements in a circle pattern, the object will rotate on that direction. If the movements are anti-clockwise the object will rotate the other direction.
So, the idea is to detect if the finger is describing circle movements, clockwise or anti-clockwise and the amount of angle. This has to be real-time, I mean, as far as the user is rotating the finger object is rotating.
I have seen apps doing something like that, where the user draws a shape and boom, the app replaces the clunky shape drawn with a pretty one. In essence the app detected that a circle, a triangle, etc., was drawn and replace that gesture with a real pretty shape.
How do I do this kind of stuff? I am just interested in circle movements.
Can you guys point me the direction?
thanks.
Check out the "hough transform for circle detection". Here is a good blog post to start with:

Detect hand swipe gesture in Unity using Kinect with OpenNI

I have a 3D model in my Unity project and I have a JavaScript that rotates the camera based on keyboard arrow keys (left/right).
Now, I need to have a script that detects a horizontal swipe hand gesture and returns a vector that I would use to rotate the camera.
I am using the ZigFu SDK with PrimeSense OpenNI/NITE. The ZigFu SDK comes with sample scripts, one of which is SwipeDetector - I am wondering how does it work?
My setup:
I have 3 GameObjects: a 3D model, a MainCamera, and a Directional Light.
So, how do I use the SwipeDetector script in my project? The way I do it right now is 1)Create an empty game object "SwipeDetection", 2) "drag and drop" the SwipeDetector script from ZigFu. I've put in logs in the SwipeDetector script, but I don't see them.
The Zigfu bindings (I'm assuming you're using version 1.4?) dont have a SwipeDetector sample, but they do include a SwipeDetector MonoBehaviour. The SwipeDetector detects vertical and horizontal swipes, but unfortunately doesn't detect the velocity of the swipe.
You have a few options:
Use the provided Swipe Detector, and rotate the camera by a fixed amount every time you detect a horizontal swipe (SwipeDetector_Left or SwipeDetector_Right events)
Use the provided Swipe Detector, start rotating on Swipe, and stop rotating on the SwipeDetector_Release event. This would be similar to pressing on the arrow keys (assuming you have the same behaviour on keydown/keyup events)
Keep track of the hand velocity, and check its value when the swipe occurs. Use this value to rotate the camera. You can keep track of velocity by creating a new MonoBehaviour, and implementing Hand_Create, Hand_Update, and Hand_Destroy (look at any of the scripts in the HandpointControls folder). Keep a queue with the hand points from the last n frames. The delta between the newest & oldest points will be your velocity for those n frames (I recommend you start with 15 frames, or about half a second)
(This will be included in a future Zigfu release :))
Your game object setup sounds right - if you dont see any logs you may not be performing the 'focus gesture' correctly. Try waving or performing a tap towards the sensor - this should cause the Hand_Create event to be called. Once you have a valid handpoint you should get the proper events from the Swipe Detector.
Also worth mentioning your swipe detection game object should have a HandPointControl component (added implicitly with RequireComponent) and that 'ActiveOnStart' should be true.