leakec / sihm

Standalone Interactive HTML Movie (SIHM): A highly-portable, interactive way to visualize your simulations.
https://leakec.github.io/sihm/
MIT License
1 stars 0 forks source link

Overall object/animation architecture #3

Closed leakec closed 1 year ago

leakec commented 1 year ago

The animation system I'm thinking of implementing for multiple objects would look like this

graph TD;
    clip1-->obj1;
    clip2-->obj1;
    clip3-->obj1;
    obj1-->mixer1;
    clip4-->obj2;
    clip5-->obj2;
    clip6-->obj2;
    obj2-->mixer2;
    mixer1-->SyncMixer;
    mixer2-->SyncMixer;
leakec commented 1 year ago

Mabye there is a way to use one animation mixer on a group, and just reference objects in the scene hierarchy.

See: https://threejs.org/docs/#api/en/animation/KeyframeTrack and: https://threejs.org/docs/#api/en/animation/PropertyBinding.parseTrackName

leakec commented 1 year ago

Okay, looks like we only need one mixer. We can use object UUIDs to reference different objects, and just pass the scene as the root to the mixer. This was done in this commit: https://github.com/leakec/Standalone-HTML-scene/commit/6616848eac423fc2b5dbdee5fafde2ff3005a9af

graph TD;
    clip1-->obj1;
    clip2-->obj1;
    clip3-->obj1;
    obj1-->mixer1;
    clip4-->obj2;
    clip5-->obj2;
    clip6-->obj2;
    obj2-->mixer1;
leakec commented 1 year ago

Closing. I added a mixer like this here: https://github.com/leakec/Standalone-HTML-scene/commit/a138f21435f5b3ee11517c62024f3d9321f508a7