jPCT-AE - a 3d engine for Android > Support

Calc 3rd SimpleVector in a line

(1/1)

K24A3:
Having a bit of a SimpleVector brain fade lol, trying to calculate the position of the yellow SimpleVector from the first two red SimpleVectors, but the yellow one has to be exactly 500 units away from the middle red SimpleVector.

I could dissect xyx of the vectors and do it the long way but what is the quickest and easiest way of doing this using calcSub etc..?

K24A3:
lol might help if I post the image

[attachment deleted by admin]

Thomas.:

--- Code: ---SimpleVector yellowPoint = point2.calcSub(point1);
yellowPoint.normalize(yellowPoint);
yellowVector.scalarMul(500);
--- End code ---

K24A3:
Awesome, thanks Thomas.

Navigation

[0] Message Index

Go to full version