Re: [pointerevents] tiltX and tiltY aren't as helpful as just having altitude angle (#274)

I've made a script to do the conversion between the two which may be useful:
https://gist.github.com/k3a/2903719bb42b48c9198d20c2d6f73ac1

* **spherical to tilt** is from Qt code but is quite obvious (projection to axes and using arctan to find angles)
* **tilt to spherical** was done by defining normal vectors of tilted planes, making the cross product of them to find the pen direction, converting it to spherical coordinates and matching angle orientation and offsets to match the *spherical to tilt* inputs.

From results it is clear that:
* **spherical angles** have highest precision when the pen is nearly parallel with the screen/tablet
* **tilt angles** have highest precision when the pen is nearly perpendicular to the screen/tablet
* in reality, the pen is held approximately 45 degrees tilted so there is little difference between the two

-- 
GitHub Notification of comment by k3a
Please view or discuss this issue at https://github.com/w3c/pointerevents/issues/274#issuecomment-491376363 using your GitHub account

Received on Friday, 10 May 2019 17:52:27 UTC