vpenades / SharpGLTF

glTF reader and writer for .NET Standard
MIT License
467 stars 75 forks source link

Animations #51

Closed bertt closed 4 years ago

bertt commented 4 years ago

Hi, is there a simple sample for getting started with animations? Like moving a box or so. I've looked in the unit tests but couldn't find it so quickly.

vpenades commented 4 years ago

Here's a good starting point:

https://github.com/vpenades/SharpGLTF/blob/8165fb67a3311bc37fd62bc4042351489d45433e/tests/SharpGLTF.Toolkit.Tests/Scenes/SceneBuilderTests.cs#L44

Pd. I don't like the "ToPoint" name too much, it makes sense for translations, but not so for rotations and scaling... any suggestion?

bertt commented 4 years ago

ok thanks, got that one working. I only see 'WithPoint' there?

vpenades commented 4 years ago

Ah, yes, WithPoint. It just happens the same curve code is used for translation, rotation and scaling, so it has the same method name for the three. I guess it makes more sense "WithKey" or something like that.