Skip to content
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

Recreated keyframe example: The same functionality, but only 7% animation code #11235

Merged
merged 1 commit into from
Apr 25, 2017
Merged

Recreated keyframe example: The same functionality, but only 7% animation code #11235

merged 1 commit into from
Apr 25, 2017

Conversation

jostschmithals
Copy link
Contributor

@jostschmithals jostschmithals commented Apr 25, 2017

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:

colladatojson

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.

@mrdoob
Copy link
Owner

mrdoob commented Apr 25, 2017

Nice nice!

@mrdoob mrdoob merged commit 15edca4 into mrdoob:dev Apr 25, 2017
@mrdoob
Copy link
Owner

mrdoob commented Apr 25, 2017

Thanks!

@bhouston
Copy link
Contributor

Sweet! The Collada animation example pre-dated the animation system rewrite.

I think the issue is that Clara.io uses Blender to create ThreeJS JSON files and Blender has some limitations regarding this scene, I suspect this file worked properly in Clara.io???

@jostschmithals
Copy link
Contributor Author

@bhouston Different from your assumption it was not only the export to three.js which was problematic. To be honest, I didn't try these exports very thoroughly, since neither Blender nor Clara.io were able to play the animations of this Collada model correctly.

Clara.io and Blender had quite different problems. Here two screenshots:

Clara.io (arranging things in places where they should not have been):

claraio

Blender (starting ca. 100 units under the grid, then suddenly popping up in frame 170, and with an end state like the one shown here):

blender

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants