2
$\begingroup$

I'm trying to have 2 curves:
- 1 for the spline that the camera will follow
- 1 for the speed of the camera

How it currently works:

  • At each frame n, I evaluate the 1st curve for n, and the camera's position is set to (n,f(n)). So currently the velocity is not implemented.
  • I have created a python script that creates the spline mesh from the f-curve. enter image description here

My problem:

  • Implementing the velocity curve. I think I need to do some math with the curves but I'm not sure what or how. With default velocity, we set the position to (n,f_1(n)). But with a different velocity, we need to find out what input to give to $f_1$

How I think it could work:

  • The velocity curve has one controlpoint for every controlpoint in the 1st curve.
  • The curve between any two controlpoints n-1 and n, indicates how fast the camera will travel from the first controlpoint to the 2nd one (in the 1st curve, which is the path)
  • Below is an image that shows how it could work. In this image, I have marked the corresponding controlpoints with red arrows
    • i.e, at frame 130, we don't want (130,f_1(130)), but we instead want (130,f_1(160))

enter image description here

$\endgroup$
6
  • $\begingroup$ i would just calculate the velocity by (f(frame+1)-f(frame))/2. I would not use the control points because this would be very inaccurate. $\endgroup$
    – Chris
    Commented May 18 at 15:41
  • $\begingroup$ What is that formula? $\endgroup$
    – kyopa
    Commented May 18 at 16:47
  • $\begingroup$ v = s / t. speed is two positions (subtracted, so you get the distance) divided by two times(subtracted, so you got the time needed to finish that distance). Frame is the time, f(frame) is the position which you already have. $\endgroup$
    – Chris
    Commented May 18 at 17:04
  • $\begingroup$ OK, thanks I understand now. How would it be applied? $\endgroup$
    – kyopa
    Commented May 18 at 17:42
  • $\begingroup$ uhm....you wrote "At each frame n, I evaluate the 1st curve for n, and the camera's position is set to (n,f(n))." and you wrote "I have created a python script that creates the spline mesh from the f-curve.". And now you ask how it would be applied? so either you didn't write that python code or you didn't understand what i meant.... $\endgroup$
    – Chris
    Commented May 19 at 10:20

0

You must log in to answer this question.

Browse other questions tagged .