# speedometer

Version:
0.1
Date Updated:
07/04/2008
Author Name:
GiaNT

So simple!
It tells you the speed of the selected object in [km/h] if your scene in meter unit.
You can easily modify to [mph] or [m/s].

If you would like, upgrade it and share for all of us! ;)
GiaNT

Version Requirement:
I think all of Max
Video URL:
AttachmentSize
speedometer.ms844 bytes

## Comment viewing options

### Nice scripting Lutteral. I

Nice scripting Lutteral. I also beat my head some time ago on this issue. May seem easy at first sight, but calculating speed is much more complicated. 1st - if we check distance, we need to work with current and previous position, not interfere future position. Else, for example, if at frame 0 our object is not moving (there is our start), then the position distance between frame -1 and +1 will return some speed as it moved, and this will be wrong result, right? And second,- distance function is welcome for straight line moving calculations, so shortly, here needed to check length of the curve. Extract trajectory to spline and so on... Might be better someday I do write this script rather than post theory here.

my recent MAXScripts RSS (archive here)

### Here's another version of a

Here's another version of a speed-o-meter. Comments welcome.
Units must be centimeters. If different, change the first line of code: Konstant = 0.036 to the corresponding value, e.g. 3.6 for meters.

M

AttachmentSize
speedometer.ms 1.75 KB

### There is global variable

There is global variable FrameRate so change code to

v = (a*3.6*FrameRate)

-- and all done :)

my recent MAXScripts RSS (archive here)

### for 30 FPS change it to v =

for 30 FPS change it to

v = (a*3.6*30)

lbl3.text = (v as string)

right under it to see the speed in the script rollout instead of having to look at the listener.

very handy script thanks!

### this is because of the 25

this is because of the 25 frame/second

at least one more people use my stuff

peace, Giant

### Thank you for your script

Thank you for your script post! I am still trying to learn MAXScript.
I have one question: what does the 25 mean in v = (a*3.6*25) ?

a = change in distance position
3.6 = conversion of m/s to km/h
25 = ?