- Home /
Divide a line between two points into lines of smaller distance.
I have an interesting math problem. I am working with path drawing and would like each path to segment to be smaller than a given length. I am noticing that when the user draws a path really fast there can be long lines between two points (because the Update() function is not called fast enough to capture the intermediate points).
How could I take a 3-dimensional line between two points and find all the points in between the original two that are some passed in distance apart?
Answer by robertbu · Feb 16, 2013 at 06:32 PM
Look at Vector3.Lerp(). Feed it however many values between 0 and 1 for the 't' parameter. If you have a lot of them to do, the math is pretty easy.
Thanks! I didn't think about that. I just had to figure out the t value based on the length of the line.
Your answer
![](https://koobas.hobune.stream/wayback/20220613092819im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
-Accurate- following of a Bézier curve 0 Answers
Suborbital Missile Pathing 2 Answers
Find point in 3D plane 3 Answers
How can I get the file path to an audioclip? 2 Answers
Simple vector math help. 1 Answer