Intent to Prototype: Altitude/Azimuth for PointerEvents v3
61 views
Skip to first unread message
Liviu Tinta
unread,
Apr 16, 2020, 5:33:36 PM4/16/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to blink-dev
liviu...@chromium.org,nzol...@chromium.orghttps://docs.google.com/document/d/1BkJDlHJvR6jndtJys7IYuqwITgVi6P9iOnfA0z5Cu04/edit?usp=sharinghttps://docs.google.com/document/d/1BkJDlHJvR6jndtJys7IYuqwITgVi6P9iOnfA0z5Cu04/edit?usp=sharing
Add Altitude/Azimuth angles to PointerEvents. Implement TiltX/TiltY to Altitude/Azimuth transformation and Altitude/Azimuth to TiltX/TiltY transformation depending which pair is available from the device.
There are two common ways for determining the inclination of a stylus:
- tiltX (angle between plane (pen,Y) and plane (Y,Z), tiltY (angle between plane (pen, X) and plane (X,Z)
- altitude (angle between stylus and screen), azimuth (angle between X axis and stylus' projection on screen)
tiltX, tiltY are the angles commonly measured by devices right now. Altitude and Azimuth can be calculated using trigonometry from tiltX, tiltY. From a hardware perspective it is easier and less expensive to measure tiltX/tiltY.
From a stylus app perspective the API altitude/azimuth makes more sense and is more intuitive for users. Using tiltX/tiltY requires a developer to visualize the intersection/angle between two imaginary planes, while azimuth, altitude are easier to visualize just by looking at the pen and the screen surface.
Adding azimuth/altitude allows developers to use a more intuitive API. Providing conversion between tiltX/tiltY and altitude/azimuth and vice versa allows for backwards compatibility with apps using tiltX/tiltY (even if newer devices might only return altitude/azimuth).