|
|
Hi,
My maths isn't great, but I have what I would imagine is
a fairly simple ray tracing problem, I was wondering if anyone
here might have a solution, as I'm stuck.
I have a reflective sphere, location LocSphere, radius RadSphere.
I have a camera, location LocCamera, looking at the sphere.
I have an object, location LocObject that is visible as a reflection in
the sphere.
I need to know the point on the sphere that the reflection comes from
(the point that the camera could look at if it wanted to look directly
towards the reflection).
I naively thought the average of the vectors from the center of
the sphere to the camera and to the the object would pass through
the point on the surface of the sphere:
#declare VecSphereToObject = (LocObject - LocSphere);
#declare VecSphereToCamera = (LocCamera - LocSphere);
#declare VecAverage = vnormalize(VecSphereToObject + VecSphereToCamera);
#declare Solution = LocSphere + VecAverage * RadSphere;
but it's not right :-(
--
I would've gotten away with it too, if it wasn't for those pesky kids!
Post a reply to this message
|
|