- Home /
finding point on the vector
i have two vectors that i use to render line. i am trying to get two points on the line that is 10% of the length distant from the end and beginning so actually i would render two lines that are part of the big line, check out the attachment
thanks!
Comment
Answer by Mike 3 · Nov 08, 2010 at 09:10 AM
You'd do something like this (in c# - change Vector3 to var for js):
Vector3 v = end - start;
Vector3 tenPercent = v / 10;
Vector3 firstTenPercentEnd = start + tenPercent;
Vector3 lastTenPercentStart = end - tenPercent;
then you just draw lines from start to firstTenPercentEnd, and lastTenPercentStart to end
Your answer
Follow this Question
Related Questions
Calculate point coords which lays on normal vector 2 Answers
Find center between 4 points 3 Answers
distance travelled on y axis 2 Answers