Skip to content

natural controls and scrolling #75

Closed

Description

@smalls

Let's look at making the interaction between controls and scrolling better, and more natural.

The issue now is that the model element, with controls enabled (after #56 is fixed), captures all events, including those that would scroll the page. On mobile where the element takes up a significant portion of screen real estate we may end up preventing any scrolling past a certain point.

We discussed some solutions that we think have potential, including (I may be missing some):

  • By default, having the model only move vertically a small amount; after that reaches the maximum, go back to scrolling the page
  • Pass initial vertical movements up to the page; the user would have to interact with the model by rotating it horizontally before they could rotate it vertically

Other options:

  • Using 2 fingers to move the model, a single finger scrolls the page
  • A button to toggle model controls

Activity

  1. smalls commented on Nov 26, 2018

    @smalls
    ContributorAuthor

    Let's get a prototype together, but we may want to iterate after that. @cdata may be able to split this out into some smaller issues.

  2. self-assigned this
    on Dec 5, 2018
  3. cdata commented on Dec 12, 2018

    @cdata
    Contributor

    Some concrete improvements being made in the first pass:

    • Velocity-based camera movement
      • OrbitControls uses a "damping" approach, which usually results in the camera overshooting its target / limits and only eases when slowing down.
    • Local-only (e.g., per-element) handling of keyboard input
      • OrbitControls uses global listeners for keyboard input
    • Keyboard arrows control orbital position by default
      • OrbitControls uses arrow keys to control panning
    • Allow unhandled events to escape control handlers
      • This will enable us to e.g., continue scrolling once the camera has reached the max polar angle
      • OrbitControls consumes all events that it handles, even if it effectively does nothing with them
  4. mrdoob commented on Jan 9, 2019

    @mrdoob
    Collaborator

    I don't think this has been fixed.
    On mobile the component still doesn't allow the user to scroll the page when it fills the page.

  5. cdata commented on Jan 9, 2019

    @cdata
    Contributor

    👍 You are right. The necessary feature is in the controls (it can be configured only to cancel handled events, which allows the user to scroll after they have rotated to the minimum polar angle), but we don't use it in <model-viewer> yet. Reopening!

  6. reopened this on Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arc: interactiontype: feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions