How to use the nudged.estimateTSR function in nudged

To help you get started, we’ve selected a few nudged examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github taataa / tapspace / examples / canvas / app.js View on Github external
range = []
        for (id in pointers) {
          if (pointers.hasOwnProperty(id)) {
            p = pointers[id]
            domain.push([p.dx, p.dy])
            range.push([p.rx, p.ry]) // copies
        // Move transformation from current pointers;
        // Turn ongoingTransformation to identity.
            p.dx = p.rx
            p.dy = p.ry
          }
        }
    // Calculate the transformation to commit and commit it by
    // combining it with the previous transformations. Total transform
    // then becomes identical with the commited ones.
        t = nudged.estimateTSR(domain, range)
        committedTransform = t.multiplyBy(committedTransform)
        totalTransform = committedTransform
      }
github taataa / tapspace / examples / play / src / Model.js View on Github external
var updateTransform = function () {
    // Calculate the total transformation from the committed transformation
    // and the points of the ongoing transformation.

    var id, p, domain, range, t
    domain = []
    range = []
    for (id in pointers) {
      if (pointers.hasOwnProperty(id)) {
        p = pointers[id]
        domain.push([p.dx, p.dy])
        range.push([p.rx, p.ry])
      }
    }
    // Calculate ongoing transform and combine it with the committed.
    t = nudged.estimateTSR(domain, range)
    totalTransform = t.multiplyBy(committedTransform)
  }
github taataa / tapspace / examples / play / app.js View on Github external
var updateTransform = function () {
    // Calculate the total transformation from the committed transformation
    // and the points of the ongoing transformation.

      var id, p, domain, range, t
      domain = []
      range = []
      for (id in pointers) {
        if (pointers.hasOwnProperty(id)) {
          p = pointers[id]
          domain.push([p.dx, p.dy])
          range.push([p.rx, p.ry])
        }
      }
    // Calculate ongoing transform and combine it with the committed.
      t = nudged.estimateTSR(domain, range)
      totalTransform = t.multiplyBy(committedTransform)
    }

nudged

Affine transformation estimator e.g. for multi-touch gestures and calibration

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis