Keep Constant Speed for different distances to Line.

Nov 23, 2013 at 2:13pm

Keep Constant Speed for different distances to Line.

Hey, I’m currently working on a graphics patch and stuck at this part.

I have different distance I’m sending to line.
For example from 0 to 1000 and from 0 to 10.

Now if I send both with the same duration to line the numbers will move more rapidly at the higher range as it is a longer distance.

Has anybody an idea how I could calculate the duration to send to line so the velocity is staying constant?

#273600
Nov 23, 2013 at 5:30pm

I have a patch for you, lemme real quick upgrade my max, since the latest osx crashes 6.1.4 constantly, hehe.

#273609
Nov 23, 2013 at 5:32pm

speed is defined as distance per unit time, so duration (the unit time bit) will be distance divided by speed:

<code>

– Pasted Max Patch, click to expand. –

</code>

#273610
Nov 23, 2013 at 5:58pm

<code>

– Pasted Max Patch, click to expand. –

</code>

#273612
Nov 23, 2013 at 6:05pm

ah, nice to see a different take on it. FPs is simpler, and I guess uses proper “units” (no idea if mine does, coincidentally, it probably does?), whereas mine is situationally aware in a sense.

#273613
Nov 24, 2013 at 1:52am

Thanks Wetterberg and Floating Point for providing your thoughts on this.
Two great solutions and both work perfectly for my purpose!

#273628
Nov 24, 2013 at 4:41am

Hey, I ran into another problem in trying to adapt the patch to my needs.

I’m using the constant line velocity to make points move to different positions in a 2D Space. For this I interpolate one X/Y to the next X/Y values via two line objects.

The constant velocity works great but now I realized that I need to calculate different speeds for the X and the Y Movement so that X1,Y1 arrive at the same point in time at X2,Y2.

For Example if X1 to X2 is 20 distance and Y1 to Y2 is 10 distance the speed of X would have to be twice the speed of Y.

Does anybody have an idea how to adapt the pacthes above for that problem? It’s completely twisting my mind..

#273638
Nov 24, 2013 at 4:42am

Hey, I ran into another problem in trying to adapt the patch to my needs.

I’m using the constant line velocity to make points move to different positions in a 2D Space. For this I interpolate one X/Y to the next X/Y values via two line objects.

The constant velocity works great but now I realized that I need to calculate different speeds for the X and the Y Movement so that X1,Y1 arrive at the same point in time at X2,Y2.

For Example if X1 to X2 is 20 distance and Y1 to Y2 is 10 distance the speed of X would have to be twice the speed of Y.

Does anybody have an idea how to adapt the pacthes above for that problem? It’s completely twisting my mind..

#273639

You must be logged in to reply to this topic.