locked
Gesture Recognizer for DX games

    Question

  • So, I don't recall which talk it was at Build, but they noted that the touch and mouse input got passed through a gesture recognition system and returned a bezier curve?

    I have been looking through the MSDN but unable to find much information on how this is setup. In the code samples I see that OnManipulationCompleted passes in the gestureRecognizer and that the ripple effect from the Photo Adjustment sample has to have some of this fucntionality (since you can 'throw' the ripple) so I assume that since the inertia is calculated that it has something to do with it.  However I am looking for the actual spline info. Maybe someone familiar with this could either explain how the functions in this area work as pertaining to getting back gesture data as a curve, or point me to the proper documentation/tutorial?

    What I would like as a general test is something where I can make a gesture, and then later trace that same line on the screen.

    Thanks

    ....

    relevant documentation:

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.input.gesturerecognizer



    • Edited by Mayarnel Friday, October 7, 2011 4:37 PM
    Friday, October 7, 2011 4:06 PM

Answers

  • Hi Mayarnel,

    GestureRecognizer takes pointer information as input and provides the calculated gestures as output.  They don't provide Bezier information about the path: only the resulting transformation.  If you want Bezier information you'll have to calculate that yourself either from the positions in the original Pointer events or by capturing the points from the manipulation events' Positions.

    Since you mentioned drawing the curve, perhaps you were thinking of Ink instead of Gestures?  You can get Bezier curves from InkStroke::GetRenderingSegments.

    --Rob

    • Marked as answer by Mayarnel Monday, October 10, 2011 4:06 PM
    Sunday, October 9, 2011 1:45 AM
    Moderator

All replies

  • Was this the session? http://channel9.msdn.com/Events/BUILD/BUILD2011/APP-186T

     


    Jeff Sanders (MSFT)
    Friday, October 7, 2011 6:37 PM
    Moderator
  • Nope, but I will certainly watch it. Also that could explain the 'throwing' if cursor prediction (or it could still be inertia) causes screen point positions ahead of where the mouse actually is.  That seemed like some weird interaction with the ripple.

    And by 'throw' i mean start ripple, move it across the screen at a high speed and let up on the mouse button and the ripple effect will be at a position far ahead of the pointer.


    • Edited by Mayarnel Friday, October 7, 2011 7:20 PM
    Friday, October 7, 2011 6:47 PM
  • So yeah, watched it and it was indeed informative, but the only thing i can think of here is that when he talked about getting all the intermediate points between frames that you get a list of points.  The talk I had listened to specifically mentioned the word 'bezier' which led me to believe that for the whole gesture I could get a curve. 

    However after watching that session it seems more like to me I should just get all the points each frame and save them off and make my own when the recognition hits complete?

    Thanks

    Friday, October 7, 2011 7:41 PM
  • Hi Mayarnel,

    GestureRecognizer takes pointer information as input and provides the calculated gestures as output.  They don't provide Bezier information about the path: only the resulting transformation.  If you want Bezier information you'll have to calculate that yourself either from the positions in the original Pointer events or by capturing the points from the manipulation events' Positions.

    Since you mentioned drawing the curve, perhaps you were thinking of Ink instead of Gestures?  You can get Bezier curves from InkStroke::GetRenderingSegments.

    --Rob

    • Marked as answer by Mayarnel Monday, October 10, 2011 4:06 PM
    Sunday, October 9, 2011 1:45 AM
    Moderator
  • Thanks for the clarification on gestures. It is indeed probable they would be talking about the IInkStrokeRenderingSegment.

    Your answer is much appreciated.

    Monday, October 10, 2011 4:10 PM