{"action":"created","issue":{"url":"https://api.github.com/repos/KhronosGroup/glTF/issues/573","repository_url":"https://api.github.com/repos/KhronosGroup/glTF","labels_url":"https://api.github.com/repos/KhronosGroup/glTF/issues/573/labels{/name}","comments_url":"https://api.github.com/repos/KhronosGroup/glTF/issues/573/comments","events_url":"https://api.github.com/repos/KhronosGroup/glTF/issues/573/events","html_url":"https://github.com/KhronosGroup/glTF/issues/573","id":150090879,"number":573,"title":"Animation loop behavior","user":{"login":"MarcoHutter","id":8885687,"avatar_url":"https://avatars.githubusercontent.com/u/8885687?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcoHutter","html_url":"https://github.com/MarcoHutter","followers_url":"https://api.github.com/users/MarcoHutter/followers","following_url":"https://api.github.com/users/MarcoHutter/following{/other_user}","gists_url":"https://api.github.com/users/MarcoHutter/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoHutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoHutter/subscriptions","organizations_url":"https://api.github.com/users/MarcoHutter/orgs","repos_url":"https://api.github.com/users/MarcoHutter/repos","events_url":"https://api.github.com/users/MarcoHutter/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoHutter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/KhronosGroup/glTF/labels/1.0.1","name":"1.0.1","color":"c5def5"},{"url":"https://api.github.com/repos/KhronosGroup/glTF/labels/specification","name":"specification","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-21T14:30:04Z","updated_at":"2016-04-25T21:16:38Z","closed_at":null,"body":"(Related to https://github.com/KhronosGroup/glTF/issues/569 to some extent)\r\n\r\nAre 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). \r\n\r\nIf 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)\r\n\r\n                0    1    2    3    4    5    6\r\n    Scene Time  |----|----|----|----|----|----|...\r\n    Animation 0           |---------|              \r\n    Animation 1      |-------------------|     \r\n\r\nit is not clear what the state of Animation 0 should be at the time `1.5` or `4.5`. One reasonable assumption is that it should be at its start- or end state (i.e. at the state of `2.0` and `4.0`, respectively). For other loop types, it would be equally reasonable to be at the state that it had at `2.5` or `3.5` (or vice versa). Are there any intentions to clarify or specify this in more detail? \r\n\r\n---\r\n(Edited to fix a typo: 2.5 instead of 0.5)\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/KhronosGroup/glTF/issues/comments/214525442","html_url":"https://github.com/KhronosGroup/glTF/issues/573#issuecomment-214525442","issue_url":"https://api.github.com/repos/KhronosGroup/glTF/issues/573","id":214525442,"user":{"login":"kbirk","id":8975956,"avatar_url":"https://avatars.githubusercontent.com/u/8975956?v=3","gravatar_id":"","url":"https://api.github.com/users/kbirk","html_url":"https://github.com/kbirk","followers_url":"https://api.github.com/users/kbirk/followers","following_url":"https://api.github.com/users/kbirk/following{/other_user}","gists_url":"https://api.github.com/users/kbirk/gists{/gist_id}","starred_url":"https://api.github.com/users/kbirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbirk/subscriptions","organizations_url":"https://api.github.com/users/kbirk/orgs","repos_url":"https://api.github.com/users/kbirk/repos","events_url":"https://api.github.com/users/kbirk/events{/privacy}","received_events_url":"https://api.github.com/users/kbirk/received_events","type":"User","site_admin":false},"created_at":"2016-04-25T21:16:37Z","updated_at":"2016-04-25T21:16:37Z","body":"I think a required `looped` boolean parameter indicating if 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.\r\n\r\nFor example, if the 'looped' property is `true`, the specification could enforce that channel values for `channel.output[0]` and `channel.output[frames.length-1]` MUST be equal.\r\n\r\nOtherwise there is ambiguity over the interpolation interval between `channel.output[frames.length-1]` and channel.output[0]`.\r\n\r\nFor 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:\r\n\r\n    TIME = [ 0, 0.5, 2.0, 5.0 ]\r\n    scale = [ [0, 0, 0], [1, 1, 1], [4, 4, 4], [10, 10, 10] ]\r\n\r\nBecause 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. \r\n\r\nDo I average the intervals and interpolate over 1.6 seconds? Do I use the previous interval and interpolate over 3 seconds?\r\n\r\nThis is occurs in the `monster.gltf` sample model. The walking animation is clearly intended to be looped, but the first and last channel output values are not equal. The TIME inputs are uniform and the method of averaging the interval is sufficient, but what about cases like the example above where the intervals are not uniform?\r\n"}}