POV-Ray : Newsgroups : povray.general : trace() direction vector Server Time
26 Nov 2024 18:26:29 EST (-0500)
  trace() direction vector (Message 1 to 4 of 4)  
From: MadKairon
Subject: trace() direction vector
Date: 2 Apr 2010 06:10:01
Message: <web.4bb5c212b56098b85e975f010@news.povray.org>
If I have thos vectors:

A = <10,10,10>
B = <5,5,5>


and I want to use trace() to trace a ray starting at A in direction to B, how do
I calculate de direction vector?


Post a reply to this message

From: clipka
Subject: Re: trace() direction vector
Date: 2 Apr 2010 07:34:37
Message: <4bb5d64d$1@news.povray.org>
Am 02.04.2010 12:08, schrieb MadKairon:
> If I have thos vectors:
>
> A =<10,10,10>
> B =<5,5,5>
>
>
> and I want to use trace() to trace a ray starting at A in direction to B, how do
> I calculate de direction vector?

#local Direction = (B-A);


Post a reply to this message

From: Kenneth
Subject: Re: trace() direction vector
Date: 2 Apr 2010 13:40:00
Message: <web.4bb62a5d27d707a665f302820@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

> #local Direction = (B-A);

A more general rule-of-thumb would be

#local Direction = (<...ending point...> - <...starting point...>)

in case MadKairon decided to start at B and end at A. But perhaps that's obvious
from your reply.  ;-)

Ken


Post a reply to this message

From: clipka
Subject: Re: trace() direction vector
Date: 2 Apr 2010 13:54:31
Message: <4bb62f57$1@news.povray.org>
Am 02.04.2010 19:35, schrieb Kenneth:

>> #local Direction = (B-A);
>
> A more general rule-of-thumb would be
>
> #local Direction = (<...ending point...>  -<...starting point...>)
>
> in case MadKairon decided to start at B and end at A. But perhaps that's obvious
> from your reply.  ;-)

Not from my reply, but from his question :-P

But of course you're right, the general formula is... well, more general 
;-).


Post a reply to this message

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