Description
Currently the explainer details how the model is placed (via it's entityTransform
) to be centered in the portal view.
The initial entityTransform is set to center the view on the boundingBoxCenter, set back by boundingBoxExtent.z/2 so that the element resides entirely within the portal, and to fit the boundingingBoxExtent within the visible view. That is, to set a uniform scale such that the boundingBoxExtent.y fits within the model's portal height, and the boundingBoxExtent.x fits within the model's portal width.
This probably works as a good default.
However, there are use cases where a different behavior would make more sense, and having a way to achieve the desired result without having to manually adjust the entityTransform
via JS would be useful.
One use case example, related to discussion of #110 involving identity scale, I may want my model to have it's entityTransform
remain the identity scale (if not other parts of matrix), and have no desire to have it changed during the bounding fit process.
One reference for this would be the object-fit
property, which has various values like fill
, contain
(analogous to existing model behavior), cover
, none
.
https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit