../ pointer

Pointer events include inputs from touch, trackpad, mouse and stylus.

basic uses

  • press: Pointer down and up
  • force: Trackpad/stylus pressure
  • visualiser: for debug purposes, show pointer movements
  • move: Based on the 'thing' model, a shape grows with pointer movement, and otherwise shrinks on its own accord.
  • drag: Based on the 'thing' model, elements are draggable, and build up an 'agitation' the more they are moved.
  • drag-spring: Drag an object, but have it snap back to its starting point with spring physics.
  • scale: pinch-to-zoom gesture (requires touch screen)
    Points tracker

computing

Derive things from basic pointer events

  • from-center: Calculate relative coordinates and distance from a fixed point
    Points.distance, Points.angle
  • geometry/math: Compute distance and angle between two points
    Points.distance, Points.angle
  • speed: calculate pointer speed in x & y
    moving average, normalising, variable fonts
  • geometry/centroid and hull: Centroid of two or more points, as well as enclosing shape
    Pointer events, Points.centroid, Points.convexHull
  • geometry/relation: Track angle, distance, centroid between two points
    Points.relation, Pointer events, relative coordinates
  • geometry/angle avg: Calculates average angle in a stream of points
    Number and point tracker
  • data/point tracker: Using the pointTracker, calculates speed of the pointer.
    Point tracker

advanced

  • remote: Demonstrates sending/receiving pointer data between sketches.
  • infinite: An extension of the 'move' sketch, but uses the Pointer Lock API for infinite pointer movement.
  • geometry/particle
    Canvas, animating points, repeat, jitter
  • next point: Attempts to predict the next pointer move
    Point tracker, vectors

    playgrounds