Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Head tracking circularity: balance diagonal movement with horizontal/vertical movement #46

Open
1j01 opened this issue Apr 13, 2024 · 0 comments
Labels
affects:desktop-app Affects the Electron app affects:web-library Affects usage of the tracky-mouse.js library enhancement New feature or request

Comments

@1j01
Copy link
Owner

1j01 commented Apr 13, 2024

I've found that moving diagonally requires too much head movement compared to horizontal/vertical movement.

  • Moving to the corners of the screen is uncomfortable, and tends to require some leaning in addition to tilting, when I have it otherwise configured to comfortably move to the left/right and top/bottom of the screen.
  • Trying to draw a circle in JS Paint, I get something squarish.

Acceleration curves may be playing a role in this. Currently the acceleration curve is applied to deltaX and deltaY independently, with the distance parameter being ignored here:

// Acceleration curves add a lot of stability,
// letting you focus on a specific point without jitter, but still move quickly.

// var accelerate = (delta, distance) => (delta / 10) * (distance ** 0.8);
// var accelerate = (delta, distance) => (delta / 1) * (Math.abs(delta) ** 0.8);
var accelerate = (delta, distance) => (delta / 1) * (Math.abs(delta * 5) ** acceleration);

var distance = Math.hypot(movementX, movementY);
var deltaX = accelerate(movementX * sensitivityX, distance);
var deltaY = accelerate(movementY * sensitivityY, distance);

If you picture the head as a sphere, it makes sense that diagonal movements are weakened, due to the projection, in combination with the acceleration curves.
Tilting up, down, left, or right, the projected point is moved in a single axis, whereas tilting diagonally moves sqrt(2)/2 in each axis.
When spread across two axes, with the acceleration curves applying separately, the exponentiation isn't as high.
That said, there may be a reason why I didn't use the distance parameter here; maybe it even makes it worse somehow.

I might need a separate sort of filter to compensate for diagonal movement feeling subdued, reminiscent of the pin-cushion adjustment on old CRT monitors.

Related:

@1j01 1j01 added enhancement New feature or request affects:web-library Affects usage of the tracky-mouse.js library affects:desktop-app Affects the Electron app labels Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:desktop-app Affects the Electron app affects:web-library Affects usage of the tracky-mouse.js library enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant