PDA

View Full Version : speed help please


nebille
08-22-2006, 01:22 PM
hi all

can anyone tell me how to test the speed of a moving object per frame
regards

Nebille

marktsang
08-22-2006, 01:58 PM
lets say you have you object obj1
get its position at frame 10 (pos1), and at frame 9 (pos2)
create a vector out of these positions vec = pos2 - pos1
which will give you a directional vector

get the lenght of the vector
length(vec)
that is the distance it traveled between frames 9 and 10
speed = distance / time

mark

PEN
08-22-2006, 02:01 PM
Or

p1=at time currentTime $theObject.pos
p2=at time (currentTime -1) $theObject.pos
velocity=distance p1 p2

CGTalk Moderation
08-22-2006, 02:01 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.