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

Announce camera orientation #325

Merged
merged 1 commit into from
Feb 1, 2019
Merged

Conversation

cdata
Copy link
Contributor

@cdata cdata commented Jan 31, 2019

This change is meant to complement a11y / interaction improvements brought by #319 and #322 .

  • When the orientation of the camera changes significantly, the new orientation is announced to screen readers
  • When the model loses focus and then regains focus, the original ARIA label is announced
  • Azimuth is separated into quadrants: front, left, back and right
  • The top third of the sphere is the "upper" pole, the bottom third is the "lower" pole

announceviewdirection

Fixes #315

@cdata cdata changed the base branch from master to announce-controls January 31, 2019 18:22
@cdata cdata force-pushed the announce-camera-orientation branch 2 times, most recently from d76cf9c to fe57deb Compare January 31, 2019 22:38
@cdata cdata requested review from jsantell and smalls January 31, 2019 22:46
@cdata cdata changed the title (WIP) Announce camera orientation Announce camera orientation Jan 31, 2019
Copy link
Contributor

@jsantell jsantell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!


import {$ariaLabel, $needsRender, $onModelLoad, $onResize, $scene, $tick} from '../model-viewer-base.js';
import {FRAMED_HEIGHT} from '../three-components/ModelScene.js';
import {SmoothControls} from '../three-components/SmoothControls.js';

const HALF_PI = Math.PI / 2.0;
const THIRD_PI = Math.PI / 3.0;
const QUARTER_PI = HALF_PI / 2.0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I'm hungry 🍰


const {theta: lastTheta, phi: lastPhi} = this[$lastSpherical];
const {theta, phi} =
this[$controls].getCameraSpherical(this[$lastSpherical]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@cdata cdata force-pushed the announce-camera-orientation branch from fe57deb to 0de7672 Compare February 1, 2019 00:47
@cdata cdata merged commit fb2d662 into announce-controls Feb 1, 2019
@cdata cdata deleted the announce-camera-orientation branch February 1, 2019 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants