|
|
On Wed, 20 Nov 2002 23:55:37 +0100
"Philippe Debar" <phd### [at] wanadoobe> wrote:
> I am not sure about al : it surely isn't the surface of the area
Yes, it's badly commented... it tries to be sqrt(sqrt(area)).
> you could have problem with square roots of negative numbers (you can
> fix that with abs, but there are several different ways to do that and
> they would produce quite different results, so...).
I do not expect negative numbers on area light vectors!
> #local al=vlength(ala1)*vlength(ala2);
Thanks! ...my maths are really poor.
> #local al=vlength(vdot(ala1,ala2));
Hmmm... sorry, as I said my maths are really bad: I can understand
the prior form (vlength*vlength), but this one scapes me, and gives
always 0. There is a typo?
--
Jaime Vives Piqueres
La Persistencia de la Ignorancia
http://www.ignorancia.org
Post a reply to this message
|
|
|
|
"Jaime Vives Piqueres" <jai### [at] ignoranciaorg> wrote in message
news:200### [at] ignoranciaorg...
> On Wed, 20 Nov 2002 23:55:37 +0100
> "Philippe Debar" <phd### [at] wanadoobe> wrote:
>
> > I am not sure about al : it surely isn't the surface of the area
>
> Yes, it's badly commented...
Well, it isn't released yet...
> it tries to be sqrt(sqrt(area)).
>
> > you could have problem with square roots of negative numbers (you can
> > fix that with abs, but there are several different ways to do that and
> > they would produce quite different results, so...).
>
> I do not expect negative numbers on area light vectors!
>
> > #local al=vlength(ala1)*vlength(ala2);
>
> Thanks! ...my maths are really poor.
>
> > #local al=vlength(vdot(ala1,ala2));
>
> Hmmm... sorry, as I said my maths are really bad: I can understand
> the prior form (vlength*vlength), but this one scapes me, and gives
> always 0. There is a typo?
Yes, there is a typo - in my head :-( I confused two functions. It should be
vcross instead of vdot. vdot gives a float and is null whenever the two
vectors are perpendicular, which is generally the case for area light
vectors... sorry. Vcross returns a vector which is perpendicular to the two
input vectors and whose length is the surface area of the parallelogram they
define.
To get sqrt(sqrt(area)), I'd use pow(vlength(vcross(ala1, ala2)),.25) -
hoping that it is right this time.
Povingly,
Philippe
Post a reply to this message
|
|