You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Configuration to control if model is centered at root origin or bounding box origin #417
Currently, we stage a model by determining its bounding box, and centering it in the viewport based on its bounding box's origin. This behavior is a reasonable default for a lot of scenarios.
Sometimes it is desirable to center a model at the origin of the root node of its scene graph. We should add a configuration that allows the user to specify this centering strategy.
This is semi-related to #271, where @jsantell mentions that this configuration might be desirable in the AR placement context.
Sometimes it is desirable to center a model at the origin of the root node of its scene graph. We should add a configuration that allows the user to specify this centering strategy.
I'd expect this new flag to put the model's origin at the bottom center of the stage; "centering" seems like a misleading description in this case (IIUC).
This is semi-related to #271, where @jsantell mentions that this configuration might be desirable in the AR placement context.
This issue (again, IIUC) describes the current AR implementation: using the model's origin. Would this attribute be necessary to not change the AR behavior? Without this attribute, would AR models use their bounding box as the floor?
I'd expect this new flag to put the model's origin at the bottom center of the stage; "centering" seems like a misleading description in this case (IIUC).
This configuration could very well be some combination of the anchor and origin (working title for both) style properties as we have previously discussed them.
For context, I'm going to share our previously discussed definitions of anchor and origin here:
Style property
Values
Default
Definition
anchor
topbottomleftrightfrontbackcenter
center
Changes how the model is positioned relative to its logical parent
origin
bounding-boxnatural
bounding-box
Changes the point that is considered the effective origin of the model
Would this attribute be necessary to not change the AR behavior? Without this attribute, would AR models use their bounding box as the floor?
I think the conservative answer here is that how a model is positioned in AR and framed inline should be determined by two distinct sets of configurations, and that configurations or defaults for one do not affect the configurations or defaults for the other.
As I'm beginning to embark on this work, it seems as though the addition of this API will be sufficient to describe user intention while remaining somewhat forward-compatible with other potential framing and controls configurations:
Attribute
Values
Default
Definition
align-model
centernatural
center
Changes how the model is aligned when being framed. Natural alignment maintains the model's original position (after scaling) along the given axis. Supports one-, two- or three-value syntax, corresponding to xyz, x y and x y z axis configurations respectively (similar to how transform-origin works).
The attribute name and the word natural could probably use some bike-shedding.
Activity
jsantell commentedon Mar 6, 2019
I'd expect this new flag to put the model's origin at the bottom center of the stage; "centering" seems like a misleading description in this case (IIUC).
This issue (again, IIUC) describes the current AR implementation: using the model's origin. Would this attribute be necessary to not change the AR behavior? Without this attribute, would AR models use their bounding box as the floor?
cdata commentedon Mar 7, 2019
This configuration could very well be some combination of the
anchorandorigin(working title for both) style properties as we have previously discussed them.For context, I'm going to share our previously discussed definitions of
anchorandoriginhere:anchortopbottomleftrightfrontbackcentercenteroriginbounding-boxnaturalbounding-boxcdata commentedon Mar 7, 2019
I think the conservative answer here is that how a model is positioned in AR and framed inline should be determined by two distinct sets of configurations, and that configurations or defaults for one do not affect the configurations or defaults for the other.
cdata commentedon Mar 18, 2019
As I'm beginning to embark on this work, it seems as though the addition of this API will be sufficient to describe user intention while remaining somewhat forward-compatible with other potential framing and controls configurations:
align-modelcenternaturalcentertransform-originworks).The attribute name and the word
naturalcould probably use some bike-shedding.cdata commentedon Mar 18, 2019
Some potential alternatives to
natural:absolutedefaultPotential alternative to
centerisbounding-box