Giter Club home page Giter Club logo

Comments (5)

fljot avatar fljot commented on July 28, 2024

@djankey

well I'd say that's due to sequential nature of delivering touch events in flash runtime (one touch event after another). So ur moving consists of small rotations mostly, because you receive one TouchEvent -> moves Touch -> delivers Touch to Gesture -> you rotate and move object a bit. Repeat.

I had idea of buffering touches in the core of the system and then delivering them into Gestures. (In JavaScript, for example, TouchEvent has not one, but array of touches, so runtimes does it for you.)
But I don't have time/motivation to do it.

What you can do to improve visuals:
In your view accumulate transformations from the gesture and apply them a bit later using any approach, for example:
stage.invalidate() + Event.RENDER approach (I'm sure you can google this invalidation approach)
or
delayed for Event.ENTER_FRAME approach.

Does it make sense to you?

from gestouch.

djankey avatar djankey commented on July 28, 2024

Thank you, it make sense.

I tried Event.RENDER and Event.ENTER_FRAME (and EXIT_FRAME) and results are approximately the same, no big difference.
When two fingers are closer to each other shakiness is worse...

from gestouch.

fljot avatar fljot commented on July 28, 2024

@djankey

You sure you did it right? Can you show your implementation?

Yeah, the closer fingers are – the bigger rotation angle after each finger movement.

Well if delay really doesn't give good result, then maybe you could look at this situation like so:
you want to ignore rotations (not apply them to the view) while you perform panning. What else distinguishes rotations while panning and more intended ones? While you pan they should be like +n, -n, +n, -n (more or less, you should log them while actually doing it). So if rotations from gesture are jumping to positive and negative values – looks like you don't want to apply them. If they're more consistent in their direction (e.g. rotations in N or more events all positive or negative) – that looks more like real rotation intent, so you need to apply some rotation to the view.

from gestouch.

djankey avatar djankey commented on July 28, 2024

This is code for ENTER_FRAME: http://pastebin.com/6tZRRJCb
Similar code is also for RENDER and invalidate...

I agree with +, - and continuous values... will try that.

from gestouch.

fljot avatar fljot commented on July 28, 2024

@djankey

hm if delay doesn't help, I means buffering in the core of the library also wouldn't do the trick.. I imagined that both fingers should dispatch touch events during one frame cycle, so if you apply accumulated transformations – it should be way better. But if you say it doesn't give nice result – I wonder how it actually happens.

If you could provide some log to see what actually happens (list of gesture responses with frame counter just for reference) – that might be useful, as input data. Apart from offsets and rotation maybe Gesture.location could be useful (center point between touches).

from gestouch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.