-
Notifications
You must be signed in to change notification settings - Fork 217
MVS: Animations #1606
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
MVS: Animations #1606
Conversation
|
This looks amazing! |
|
@corredD I had to rename |
|
the kind: 'transform_matrix' is really great, can I use it to do a spin animation with multiple turn ? |
@corredD I've added |
this is excellent! Can you show me how to use it for a full turn rotation ? I am sorry I can't figure out how to do it. I couldn't make 0 to 2pi to be interpolated. If I trick with 2pi - 0.1 it will interpolate on the shortest path. |
|
@corredD its not possible to do the 4 rotations... the quaternion interpolation will always do the shortest path. Seems like we need the ability to interpolate axis/angle combo as well. Will have a look tomorrow. Getting more and more complicated :) |
|
@dsehnal I found a solution that worked for me, I attached the patch file |
|
@corredD Thanks, I've included the changes to work for both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super cool.
It's a big chunk of changes. The part that i was able to understand, looks good.
See a few comments.
| // Uncomment this to make 2nd frame render much faster | ||
| // It will cause shader compilation to happen during the 1st snapshot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By chance, is there any way of detecting which shaders will be needed during the whole animation and pre-compiling them, so the users don't need to use hacks like this?
I understand this might be too much to want, just bringing up the idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this with Alex. In theory it might be possible to compile them ahead of time.
|
|
||
| const Vec3Interpolation = { | ||
| ..._Common, | ||
| start: OptionalField(nullable(list(float)), null, 'Start value. If unset, parent state value is used. Must be array of length 3N.'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a type Vector3, you can use it instead of list(float)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This supports flat lists of vectors, so you can pass 6 numbers to it for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then pls don't call it Vec3Interpolation.
If we can interpolate custom-length vectors, that means we can interpolate mesh shapes, which will look cool :)
(not sure about a use-case though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still vec3 interpolation, it can just interpolate multiple vectors at the same time.
| ..._Common, | ||
| start: OptionalField(nullable(list(float)), null, 'Start value. If unset, parent state value is used. Must be array of length 3N.'), | ||
| end: OptionalField(nullable(list(float)), null, 'End value. Must be array of length 3N. If unset, only noise is applied.'), | ||
| spherical: OptionalField(bool, false, 'Whether to use spherical interpolation.'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do i understand correctly that spherical interpolation mean interpolation via the surface of a sphere rather than via a straight line?
What is the use-case for this?
Is it sufficient to have the center of the sphere always [0,0,0], or does the use-case require parametrization for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's this https://en.wikipedia.org/wiki/Slerp
| // if there is a blocking operation, e.g., shader compilation | ||
| // The drawback of this is that sometimes the animation will take | ||
| // longer than intended, but hopefully that's a reasonable tradeoff | ||
| private properTimeT: number = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fair enough in the UI. Freezing seems better then freezing+skipping.
But when i export animation, the timing will be exact, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is just for the UI-driven animations.
src/mol-util/color/color.ts
Outdated
| const interpolateHcl2 = Hcl.zero(); | ||
|
|
||
| /** Linear interpolation between two colors in HCL space */ | ||
| export function interpolateHcl(c1: Color, c2: Color, t: number): Color { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, i'm very sceptical about HCL in general.
It tries to tell me that all colors in the first row are the same hue. The same for the second row.
And also that colors in each column have the same CL and only differ in H.
(first rows = hcl(270, 100, 0-100), second row = hcl(300, 100, 0-100))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add HSL implementation as well then? Perhaps that could be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added HSL.
|
I'm wondering: how does easing work in combination with alternate_direction? E.g. does quad-in become quad-out on the way back? |
Is easing actually implemented? I cannot find the code. |
It reverses the time. It's
There was existing port of D3 easing the codebase before. |
|
Gonna merge this now and do fixes in a separate PR if needed. |
Description
StateTransform.versionHslcolor spaceStateAnimationinPluginStatetransform.rotation_centerparamcanvas.background_coloroptional parameterPython MVS PR: molstar/mol-view-spec#89
1CBS_state-snapshots.4.mp4
Actions
[Unreleased]section ofCHANGELOG.mdpackage.json'scontributorsdocs