kzaurckichz
New member
- Joined
- Feb 2, 2020
- Messages
- 4
I know about existing formulas to intersect a vector with a sphere, but it is not efficient because I already have some of the information that I am sure can make it much, much simpler
I need to find the distance to the closest point on a sphere, based only on the following information that I already have :
* the distance to the furthest point (second hit point)
* the direction of the line
* the distance from the center of the sphere
* the radius of the sphere
* the normal direction of the second hit
Again, I need to find the closest hit Distance, no need for actual position.
Is it possible ?
I already have a temporary formula that kinda works but is not exactly that, there seem to be an distortion..
What I have is : hit1Distance = hit2Distance + sphereRadius * 2 * dot(lineDirection, hit2Normal)
I do not think it is a good formula, I basically invented it.
I need to find the distance to the closest point on a sphere, based only on the following information that I already have :
* the distance to the furthest point (second hit point)
* the direction of the line
* the distance from the center of the sphere
* the radius of the sphere
* the normal direction of the second hit
Again, I need to find the closest hit Distance, no need for actual position.
Is it possible ?
I already have a temporary formula that kinda works but is not exactly that, there seem to be an distortion..
What I have is : hit1Distance = hit2Distance + sphereRadius * 2 * dot(lineDirection, hit2Normal)
I do not think it is a good formula, I basically invented it.
Last edited: