Skip to content

Model should be placed where expected in WebXR #271

Closed

Description

@jsantell

Currently, we rely on the model correctly setting its origin to (0, 0, 0) and assuming that is the floor surface -- if you've looked at the scale and origin of any model found across the internet, you'll know that models are often not positioned with these caveats. There's also the issue of models not using 1 unit == 1m, but less assumptions we can make there and a separate issue.

If we center the model on X/Z according to its bounding box, and set its lowest point on the Y as its floor, this will give the desired result for most use cases, I think. The exceptions are things that should appear floating, or models that should have things 'underground' (e.g. vines hanging over a ledge), or using the models position to bake an off-center pose.

In the future, probably something that should be configurable (use volume to determine center/ground, or use model's origin), but applying this logic in AR would match the framing logic in 2D mode, and what's desired most of the time IMO, and fix the issue of placing something in AR, and it appearing like it doesn't work because the model is 2 meters off screen from the hit.

IIRC, the current placement logic was influenced by ideas of composing multiple models which complicates this, which doesn't apply to the current component.

Activity

  1. added
    type: bug
    on Dec 9, 2018
  2. elalish commented on Mar 10, 2020

    @elalish
    Contributor

    This was fixed when we redid framing and introduced camera-target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arc: artype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions