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 |
| // 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.
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.
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.
We have a type Vector3, you can use it instead of list(float)
There was a problem hiding this comment.
This supports flat lists of vectors, so you can pass 6 numbers to it for example.
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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.
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.
Maybe add HSL implementation as well then? Perhaps that could be better?
|
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