About this site
ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
Comments
This method is suitable for
This method is suitable for straightforward motion but if you change the direction it needs a little math to calculate a trajectory and I am not very good at math :)
my recent MAXScripts RSS (archive here)
hi, this is very cool!
hi, this is very cool! although i'm no scripter at all :)
sascha
I figured out this method:
I figured out this method:
prePos = at time (currentTime - 1t) self.pos
nextPos = at time (currentTime + 1t) self.pos
d = distance prePos nextPos
v = d*4800/2 -- unit:inch/s
v = v*2.54/1000 -- unit:m/s
v = v*60*60/1000 -- unit:km/h
It could be precise enough for most circumstances.
And a friend showed me this method:
prePos = at time (currentTime - 1t) self.pos
curPos = self.pos
nextPos = at time (currentTime + 1t) self.pos
d1 = distance prePos curPos
d2 = distance curPos nextPos
d = (d1+d2)/2
v = d*4800/2 -- unit:inch/s
v = v*2.54/1000 -- unit:m/s
v = v*60*60/1000 -- unit:km/h