How to configure model-viewer bounds for animated models? #2176
Replies: 2 comments
-
@soraryu Indeed, this is a limitation. Unfortunately I have no performant way to calculate the bounds of an animated model. Currently the calculation is based on the resting position, so you could make the "largest" animation frame the resting position and then select a different animation when starting to present. However, the primary means we give to address this is to change the camera attributes (orbit radius, target) so that you can control framing manually instead of using the calculated values. |
Beta Was this translation helpful? Give feedback.
-
@soraryu Also, changing the attributes manually might be nice, since you could choose to frame the model close at first, then pull back when playing the exploding animation. |
Beta Was this translation helpful? Give feedback.
-
Description
Seems it is not possible to change how model-viewer presents a model - the bounding box seems to come from the original, un-animated model (?).
In this case, we have a typical "explosion view" where the model expands beyond the un-animated bounding box. Ideally, bounding box would be user-specifiable so that it could be adjusted for this; if it needs to be automatic, it might be possible to automatically generate it from the largest bounding box during animation.
I guess (haven't tried yet) a workaround is to have teeny tiny little objects (that are essentially invisible) on the "edges" of the animation bounding box to force a larger bounds area.
Live Demo
https://glitch.com/edit/#!/bright-lunaria
Browser Affected
OS
Versions
Beta Was this translation helpful? Give feedback.
All reactions