Recreated keyframe example: The same functionality, but only 7% animation code #11235
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For this PR I recreated the Collada keyframe example (the blue pump) 1:1 with pure JSON and three.js core animations.
The reason: The Collada example seems to be the only example that demonstrates a complex keyframe animation without bones or morph targets (moving/rotating whole objects instead). This fact can cause people to assume that keyframe animations of that kind require a Collada model import, the special additional animation scripts used in the Collada example, and a plenty of complex code to make it work (see for example this recent stackoverflow question/answer).
But of course this is not true: Using a JSON file (instead of a Collada file) and the core animation system (instead of the additional animation scripts) makes things much simpler; actually it's a three-liner now 😉.
Here an impressive comparison:
Converting this special model from Collada to JSON was some manual work (neither Blender nor Clara.io were able to play the Collada animations of this model correctly - I think because of some inconsistencies in the original file -, so that both programs couldn’t be used for converting in this case); thus converting from Collada to JSON first could perhaps not be recommended for each use case.
But this alternate version of the keyframe example could vice versa prevent people from unnecessarily converting their models to Collada first, only because they are misleaded to believe that this would be the preferred way to play complex automated keyframe animations in three.js.