alecjacobson / computer-graphics-kinematics

Computer Graphics Assignment about Kinematics
94 stars 32 forks source link

Catmull Rom Interpolation time #29

Open zhufyaxel opened 5 years ago

zhufyaxel commented 5 years ago

It seems like the time we will pass to the Catmull-Rom-Interpolation is exact the seconds in the software, which will easily pass the limitation within the maximum keyframe time we implemented.

I'm wondering shall we loop the 't' passed into the Catmull-Rom-Interpolation? if so, does this make sense that all the time passed the maximum keyframe time will be instantly set into 0, or some gap time need to be set after maximum time?

Also, if we set the loop to happen, shall there be any Interpolation during the frame between maxium -> first frame, or there is nothing required to happen within that scope?

abhimadan commented 5 years ago

Either looping the animation or clamping after the last keyframe is fine.

zhufyaxel commented 5 years ago

Thanks. I'm also wondering if we can always expect that the keyframe lists will have a keyframe at t = 0, or it is possible that we will get some list starting the keyframe which may not set to t = 0? As in that case, determine where the target is between (0, t_0) will be a very tricky thing to do.

Also wondering for the keyframe[0] and keyframe[size() - 1], is that OK for us to set their tangent as 0, or we'd better calculate a mirrored point to present the position on keyframe[-1] and keyframe[size()] and then calculate their tangent?

abhimadan commented 5 years ago

You can assume that an animation starts at the time of the first keyframe.

If you aren't looping your animation, you still won't have a tangent of 0 at the boundaries in general, so it's not correct to simply set the boundary tangents to 0. However, you can try to make a reasonable guess for these slopes; for example, you can artificially extend the curve by adding another point past the boundary.