Hi All. I have 2 nodes (in 3D) and I need to find a position between them which is not just half-way from one to the other but closer to one or the other depending on other conditions.
Finding a midpoint between 2 vectors is kinda easy: sum them up and divide by 2.
But... What I need to do is to find a Vector3 that sits somewhere on the line connecting 2 other Vector3's but its distance (on that line) from the primary vector3 to the secondary vector3 (ie, the 2 ends of the line) depends on the primary Vector3's distance from a different node in the scene. I'll call it the tertiary vector.
The data I have available is:
- Primary Vector3
- Secondary Vector3
- Distances between Primary, Secondary, and Tertiary Vector3's
Eg, say the distance between primary and secondary Vector3 is 10. The distance between primary and tertiary is 100. In this case I want the looked-for Vector to be closer to the secondary vector (10ish units away from primary). But if the distance between primary and tertiary Vector3 is 1, I want the looked-for Vector to be 0.1 units away from the primary.
Please help my math...