[Closed] speed along path controller
Thanks Decon! I studied it a bit and gives me a better understanding. Soo in short, you calculate the velocity up to the current frame, then to find the current distance, divide the sum of the velocity with the path length and frame rate? Correct me if I’m wrong but that’s my understanding of it so far :P.
On another note, would this concept work with rotations as well? I’ve tried an expression that would rotate an object’s axis based on a spinner’s value. This figures out the rpm of the object, but the same problem occurs with the rotation reversing if you animate the value being lowered. I suppose it’s the same idea here?
Actually wouldn’t this work?
rpm = (0.1047 * S)*val01 -- When value is set to 1.0, the object does a full rotation each minute.
finalVal = 0
for i = 1 to currentTime do
(
addVal = (at time (i) rpm) - (at time (i-1) rpm)
finalVal = finalVal += addVal
)
finalVal
So figure out the difference of rpm between the current frame and the last frame, then add it onto our final value. This way when you ramp it down it shouldn't reverse the rotation. In theory of course!
Only problem is the at time function isn't giving me the proper value for some reason, instead only giving the current frame's.
i’m not sure where it goes wrong, but this works the same way as earlier:
-- contr. Euler z
-- a Box01 with height of 1m equals to 100 rpm (25fr/s)
rpm = 100
ch = 2 * pi / 25 * 0.0254 / 60 * rpm
finalVal = 0
ct = currentTime
for i = 1 to ct do
(
addVal = at time i $Box01.height * ch
finalVal = finalVal + addVal
)
finalVal
Sorry to bring this back up, but I’m having trouble with linking the speed to a custom-attribute-slider. Everything works fine when I link it to the height of a box, but as soon as I link it to a slider, it doesn’t work anymore.
Hi Laserschwert,
check the script (add car path) in this archive http://zelosh.zoomshare.com/files/simplecarrig.zip
when you select car in the file and run it, then pick path, it creates attribute holder with speed spinner, which
is linked to the position script controller speed value… hope it helps, am script beginner…
filip
Thanks, I’ll have a look for it, though for now I’ve solved my problem using viewport-sliders, which seem to work.