Notifications
Clear all

[Closed] [MATH][WIP] accelaration along path

Please, check this macroscript I wrote long ago and was very useful in my work as forensic animator.

 It measures the speed and distance of moving objects along a path.

It works with MAX4 or later versions and this is the idea about it:

 It is based on a path controller applied to the object as a list controller, the default when a path restriction is applied by max (Animation > Restriction > Path restriction).

But the percent gets another list controller, one to measure the speed and another one to the distance traveled along the path.

   The speed controller named (1Km_H) has applied two keys so that moving at a unitary speed. (1 Kilometer per hour or 1 mile per hour).

This arises to divide 100 % of the percentage by the total distance of the trajectory and by 3,6 (1 / curveLngth ThePath / 3.6). And 3.6 = 1000 meters / 3600 seconds.
But the scripts knows the system units to take care of it (the same to frame rate, in my country 25 fps and in yours 30 fps)

To the distance controller (1MdelOrigen), it has applied a key that determines a unitary value (1 meter that leaves to divide in 100% by the length overall of the trajectory) (1 / curveLngth ThePath).

Both controllers have applied as well a multiplier curve. And this one with a linear (or bezier) controller determines the speed and distances in real units. Because it multiplies the unit value by a factor (in Km/H in a case and meters in the other).

The program does everything automatically but of such form that allows the user to modify the variables after, because it has controllers which determine the speed and distanced traveled in real fisic units.

 The script is based on velGraph-v2_00.ms by Randy Kreitzman, and many many things I’ve learnd from Swami.

Excuse me for my english and let me know if this scripts may me improved.

 Fernando Ferro

Buenos Aires – Argentina

 rdg

I can crash your script, too :applause:.
(when switching from mts/s to km/h)

serious:
Your tool looks really interesting!
In fact it is far more complex than mine.

I like the possibility to control multiple vehicles.
And the possibility to change values.
Mine is still more a simulation.

Georg

I don’t know if the script works in the english version. I have the spanish and for example:
.multiplier_curve is .curva_multiplicadora
$Line01 is $Linea01 and so on…

I’ll check that about Km/H and m/s
Let me know if you find any problems.
Thanks
Fernando Ferro
Buenos Aires – Argentina

Sorry about that (km/H to m/s)
It’s fixed now. I’ve uplodaded the new version here (0.9.1)

note about ‘distance to another’ group:

(distance to another: / movil)
You have to create a tape object and link it to one object and the target to another object, both moving on the path or linked to dummies moving on the same path.
Then with one object visible in the dropdownlist below ‘movil’ and ‘selected’, click ‘distance to another:/movil’. pick the tape and you will see the length of the tape but projected over the path.
This is useful to know the minimal distance between two vehicles before they crash.

(distance to another: / time)
check this button once. Then you will see the distance traveled from this time along the path.

Fernando Ferro
Buenos Aires – Argentina

 rdg

thanks Fernando,

the script now works, and and in the meantime I think I understand what it does

The stuff with the normalised speed in the Path_Constraint and the MultiplierCurve is great. I will see if I can use this in my script.

My scenario is a different one, though:
I have a street with known speeds/speedLimits at different distances.
A MultiplierCurve is based on time – thats why I am using the CurveControll:
It is a time independent way to place the ‘speed signs’.
After placing all speedLimits the script calculates the position/time for the car.

In your script if you animate the speed of the car, it isn’t easy to get the car to have a speed at a specified point …

But I guess your scenario is different as a forensic animator.

How do you get ‘forensic’?

the language-dependance of maxScript is really strange …

hi rdg,
you gave me a great idea to improve my script. More than this, you’ve woke up my interest.
You are right when mention the difficulty to control the speed at every moment.
I’m very often, fixing the speed first and then moving the spinner to set the distance traveled.
But it would be very useful that the script by itself set keys at any time. And mainly that does not change the distance traveled when changing the speed.

Well I’m working on it rigth now.

Talking about ‘forensic’, in Argentina my profession has ‘no name’. For my and some colleagues may be ‘reconstructor forense’, that’s why I translated it as ‘forensic animator’ but I don’t know if this is correct.
The other great difference with You is that here a reconstruction costs 1000 when there 3000…
I will check your script to learn more. see you

 rdg

And mainly that does not change the distance traveled when changing the speed.

that is not possible, is it?
If you change the speed at a point, then the position changes, too.

Georg

To stay in place when varying the speed my idea is to compensate in one multiplier_curve (1MdelOrigen) which increases in the other (1Km_H).

Supose you have a dummy travelling at 10 m/s (meters per second). Then you increase de velocity with the spinner in 1 m/s at time 10 sec., the new value for (1Km_H).curve_multiplier will be 11.
Now the script increase (1MdelOrigen).curve_multiplier from 100 to 110, moving the dummy 10 meters forward.
In order to solve this the script would reduce in 10 meters the curve_multiplier (1MdelOrigen) to fix the dummy in place.

Page 3 / 3