Skip to content

Establish concrete definition of 1 meter as it relates to user-configurable API #450

Closed

Description

@cdata

As we begin to land changes for features such as #98 , users will begin to express configuration with metric units that should correspond to reliable positions and distances in world space, regardless of how models are framed.

Currently in 3D inline rendering, we "frame" models by establishing a virtual "room" box and scaling the room and the model with the following steps (approximately):

  1. Determine the aspectRatio of the <model-viewer> element's bounding rect
  2. Set the height of room to 10, and the width of room to 10 * aspectRatio in world units
  3. Apply a scale to model so that its extents all fit inside of room
  4. If the depth of room is greater than the depth of model, shorten the depth of room by the difference

It is important for users to be able to trust that as a model scales based on responsive layout conditions, the camera and other configurable elements that rely on world space positioning update in a predictable, desirable way.

This issue covers the work needed to review what it means to specify positions and distances in metric units, and how those values are affected as the layout of <model-viewer> changes over time (thus causing the scaling of the model itself to change over time).

Activity

  1. elalish commented on Apr 26, 2019

    @elalish
    Contributor

    The most obvious solution to this that I see, and for #197 as well, is to remove all concept of a "room", leaving model at model scale and adjusting the camera as necessary in model-based units (including near and far plane). However, that would be a significant change, so I'd like to know if I'm missing anything before I start designing that.

    What was the original goal of the room? Should we try to keep the default framing identical to how it is now, or is there anything in the current version that someone isn't happy with? I'd be temped bound the model with a cylinder rather than a box, given our az-el camera.

  2. cdata commented on Apr 26, 2019

    @cdata
    ContributorAuthor

    I would say that the floor is open for a good design proposal that addresses scaling in a way that works coherently across inline and unbounded (e.g., AR placement) use cases. Naive approaches have their limitations here.

    The "room" dates back to the <xr-model> prototype and was meant to serve as a framing helper. It is useful to conceptualize a room when deciding how to adjust the camera frustum for some of the immersive use cases we were exploring, but I would not characterize it as a critical element of framing for today's <model-viewer>.

  3. self-assigned this
    on May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions