-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Animation loop behavior #573
Comments
Not immediately, but this is something that an app could put in an
I agree that the spec should be explicit about out of range times so I labeled this issue My initial thought is to say that all times must be in range; otherwise, the implementation is not valid. This gives the implementation freedom to loop different animations in different ways, albeit two valid renderers could loop differently, but I do not know if this is a pragmatic concern. |
I think a looped parameter indicating how an animation is intended to be looped would be very helpful to consumers of the glTF format and would allow the specification to remove any ambiguity over the intervals of interpolation. For example, if the looped property is Otherwise there is ambiguity over the interpolation interval between For example, let's say we have a model that has an animation that is clearly intended to be looped with the following TIME inputs and scale outputs:
Because scale[0] and scale[3] are not equal, it would indicate that there should be interpolation between frame 3 and frame 0. But the length interval over which to interpolate is completely ambiguous. Do I average the intervals and interpolate over 1.6 seconds? Do I use the previous interval and interpolate over 3 seconds? This is occurs in the |
This issue mainly referred to whether it should be possible to define the desired looping behavior at all. (The proper interpretation of the times is probably well covered with this other issue, where Patrick pointed out the crucial question in #569 (comment) . When it is clear how the "global" time is mapped to the "local" time, it may become clearer how to define looping behaviors - however, if this mapping is not specified yet, then one should keep in mind that different looping behaviors might have to be supported in the future) For the looping behaviors, there are some caveats. The described semantics of a Further questions, e.g. whether it should be possible to specify the looping behavior for each animation individually (or maybe even for each channel?) will have to be considered as well, but all this will have to be validated carefully when a decision is made of whether the spec will be extended accordingly. |
Good point about an intended jump in animation, that was definitely an oversight on my part. However enforcing that there is to be no interpolation between frames N-1 to 0 in a looped animation would remove the ambiguity as to whether an animation should jump or not. For example: Jumping animation
Smooth animation
|
Actually ran into this general issue in Cesium recently, CesiumGS/cesium#3934. |
Can we allow also non-interpolated samplers (think of frame by frame animation)? |
Yes. Can you open a pull request for the spec/schema?
Yes, if there are sufficient use cases. What are use cases do you have in mind? Also, labeling this 1.1 so 1.0.1 stays focused on validation, not new features. |
Hard key frames on camera position/rotation to make "cuts". Also such technique could be used to avoid runtime cost of interpolation (if we pre-sample matrices for each frame). Eternal trade off: computing or storage/bandwidth. |
Sounds potentially useful. Are you sure that this is commonly done in one animation, e.g., not two separate animations? We need to be careful to not let feature-creep make the glTF spec complex; everything needs to be supported by widely needed use cases, and then corner cases can be handled by extensions or application-specific |
Of course not. Real-world cinematic camera movements/cuts are very complex and can consist of several consequential non-linear animations. At the current state of spec, Such change will also benefit app-specific |
Sorry, I am confused. You think this will not be commonly done, but you suggest that we add it? If that is the case, we should seek more community feedback to avoid adding features that are not generally useful. If I'm misunderstanding, please let me know. |
After re-reading what I've written, I agree it sounds confusing. But the point is very simple, actually: Now, we have only linear interpolation. First, it will allow to do a "stop-motion" animation (including the simpliest camera cuts) or "slide-shows". Second, it will make extending via |
Do you have real-world pragmatic use cases for the "stop-motion" animation? If not, do others? Perhaps in fields beyond games, e.g., robotics, data visualization, etc.? That can guide us to add this. Otherwise, I think this is a "solution without a problem" - and glTF painstakingly tries to avoid this; it is a format grounded in widely needed use cases. |
Even games can use it for "mechanical" animation look (think of second hand of a clock). Btw, COLLADA recognizes the following interpolation types: LINEAR, BEZIER, CARDINAL, HERMITE, BSPLINE, and STEP. Thus, having |
Constant is also in OpenGEX; see Page 77: http://opengex.org/OpenGEX.1.1.2.pdf I suppose I am fine with adding it given that it is trivial, but I would really like to hear from one user who needs this before adding it to |
Is this related to or perhaps even replaced by #1137? |
There are some differences in scope: #1137 deals with portable assets that can be dropped into a world and bring behaviors (animate on touch, etc.) with them. This issue revolves around complete scenes and assumes there is a concept of "scene time", so that's a very different use case. My vote would be to only move forward on this if/when there are concrete use cases and interested parties driving it, and then to do so in an extension like #1137. No preference on whether we want to keep the issue open in the meantime. |
@donmccurdy OK with me. @MarcoHutter up to you if you want to keep this open or close. |
In order to prevent scattering the discussion between many issues, I think this one should be closed, as a more recent one has been opened with #1179 |
(Related to #569 to some extent)
Are there any plans to support different looping behaviors for animations? For example, whether animations should be ran once, or in a loop, or in a ping-pong fashion? (This is roughly refering to https://cesiumjs.org/Cesium/Build/Documentation/ModelAnimationLoop.html).
If so, this would raises some questions about the interpretation of the times that are given as the key times for the animation, going beyond the issue linked above. For example, for two animations (sketching the time lines here)
it is not clear what the state of Animation 0 should be at the time
1.5
or4.5
. One reasonable assumption is that it should be at its start- or end state (i.e. at the state of2.0
and4.0
, respectively). For other loop types, it would be equally reasonable to be at the state that it had at2.5
or3.5
(or vice versa). Are there any intentions to clarify or specify this in more detail?(Edited to fix a typo: 2.5 instead of 0.5)
The text was updated successfully, but these errors were encountered: