POV-Ray : Newsgroups : povray.newusers : probably a simple problem Server Time
4 Nov 2024 23:16:39 EST (-0500)
  probably a simple problem (Message 1 to 3 of 3)  
From: Bill Hails
Subject: probably a simple problem
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

From: Micha Riser
Subject: Re: probably a simple problem
Date: 19 Mar 2003 14:43:34
Message: <3e78c866@news.povray.org>
Bill Hails wrote:

> 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).
> 
> 

If I understand your problem correctly the soulution is equivalent to what 
if have done some time ago. See

  http://news.povray.org/povray.general/22853/
and
  http://news.povray.org/povray.text.scene-files/23166/

- Micha

-- 
POV-Ray Objects Collection: http://objects.povworld.org


Post a reply to this message

From: Bill Hails
Subject: Re: probably a simple problem
Date: 19 Mar 2003 16:40:46
Message: <3e78e3dd@news.povray.org>
Micha Riser wrote:

> Bill Hails wrote:
> 
>> 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).
>> 
>> 
> 
> If I understand your problem correctly the soulution is equivalent to what
> if have done some time ago. See
> 
>   http://news.povray.org/povray.general/22853/
> and
>   http://news.povray.org/povray.text.scene-files/23166/
> 
> - Micha
> 

That's exactly what I was after, thanks very much!

-- 
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.