I have a two points in 3D space, let’s say (0, 0, 0) and (5, 5, 0)
and I have a camera at (0,0,5)
Given this, the first point (0,0,0) is closer to the camera than the second. What I would like to do is have that second point be limited in distance from the camera point, so that it (or really any hypothetical point) cannot be farther away from the camera point than the distance of my control point (0,0,0).
What is the mathematical apparatus I can use to calculate a point in space that is the same vector from the camera, but not as far away?
I hope this makes sense… and I wish I had taken any math classes higher than basic algebra.
If I understand this correctly. You have point lets P1 (x1, y1 , z1) and a distance D and another point P2 (x2 , y2 , z2) and you want another point P3 so that it is in the same direction as P2 but only distance D from P1. if that is the case.
Direction V1 from P1 to P2 is ( P2 – P1 ) ie ( x2 – x1 , y2 – y1 , z2 – z1 )
Unit vector from V1 would U1
Formula for distance between two points
And finally P3 will be a distance of D along this unit vector