Code Monkey home page Code Monkey logo

Comments (2)

ManDay avatar ManDay commented on August 22, 2024

As a bit of undirected brainstorming: For stability (position measurement noise in high frequency touch events) the incident angle at the circle boundary should most likely be inferred from more than just the 2 last touch events.

The easiest and most straight-forward method would probably be taking an weighted average of the angles between the last point and several points before that. The further away the respective 2nd point, the more stable the inferred inclination -- but of course also less relevant. I'll try to come up with an implementation which is appropriately simple (and doesn't rely on maintaining a variable-length list of previous points, like this naive approach).

from 8vim.

ManDay avatar ManDay commented on August 22, 2024

With several months of experience of using the adaptive ("dynamic") circle, I think I could develop a good grasp of where problems remain and what is needed to create a more reliable input experience, using the (so far unusused) inclination data. It should be mentioned that the following does not require a stabilization of the trajectory.

This is about how we detect the return into the circle from one of the sectors! By using inclination information, we should be able to prevent accidental returns into the circle.

"Traditonally", accidental returns into the circle by cutting across the circle prematurely, look something like this:

cut

Here, we accidentally returned from the upper sector into the circle. They occur when we don't take the time to perform a well rounded circle, but are too hasty. If they happen, too often, we so far have two knobs to turn to address this:

  1. We take greater care to fully go around the circle, which will cost us time and effort.
  2. We shrink the circle, which will demand greater precision to return into the circle.

Looking at the picture above, it is intuitively evident that the trajectory did not mean to return into the upper circle. That intuition comes from the fact that the trajectory did not aim towards the circle at that point; the inclination was too low, it went tangentially to the boundary.

Therefore, we should add a condition for the detection of the return from a given sector into the circle:

To count as a return from a sector into the circle, the trajectory must be pointing towards the circle center (i.e. the inclination be 90°) within an error of ±E, where E would typically be something like 45°.

inc

Here, the first crossing into the circle in the upper sector is ignored, because the trajectory/tangent (blue) does not lie within the permitted range (green triangle) around the ray into the circle center (green line). The second crossing from the left sector, however, is detected, because the inclination is sufficiently high.

Although we could, at this point, detect the "return into the circle" (i.e. termination of a sequence) without any notion of the circle, we will want to keep it around as an upper limit to inclination detection, so as to not fall off the other side of the problem, and accidentally detect termination from a steep inclination, like here:

toofar

However, we should still improve the rule to deal with reversal (a.k.a. "variants", "layers"), because those will, if accidentally performed within the diameter of the circle, trigger the inclination detection (either unstably or because the reversal turned towards the circle center):

A detection will occur, if the sufficient inclination (90 ± E) from a given point P traverses at least the following distance: max(exterior distance, reversal margin), where exterior distance is the distance of P from the circle boundary and reversal margin is a configured ratio of R the distance of P to the circle center, where R is typically something like 10%.

Concretely, we check the inclination at every touch/move event (coming from the last touch event). If it reaches 90 ± E, we set the "termination circle" to be of radius min(circle radius,touch radius * (1-R)). If the inclination leaves the 90 ± E region, we unset "the termination circle". If the "termination circle" is set and the trajectory moves into it, the sequence ends.

Comments and questions or so (in case this was too confusing) welcome!

PS: The part about traversal distance is what makes stabilization superfluous.

from 8vim.

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.