POV-Ray : Newsgroups : povray.newusers : probably a simple problem : probably a simple problem Server Time
31 Jul 2024 02:28:26 EDT (-0400)
  probably a simple problem  
From: Bill Hails
Date: 19 Mar 2003 13:36:56
Message: <3e78b8c8@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.