POV-Ray : Newsgroups : povray.beta-test : Vanish/Ghost/Killer bug Server Time
29 Jul 2024 18:24:43 EDT (-0400)
  Vanish/Ghost/Killer bug (Message 1 to 6 of 6)  
From: Tim Nikias
Subject: Vanish/Ghost/Killer bug
Date: 15 Apr 2002 14:58:58
Message: <3CBB230A.1E027FE2@gmx.de>
For those who have followed my recent bug-reports
about vanishing objects, focal-blur etc, I've posted
a minimum scene-file in beta-test.binaries.

I've tracked the bug down to a
vnormalize(<0,0,0>) used as a translation.

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde


Post a reply to this message

From: ingo
Subject: Re: Vanish/Ghost/Killer bug
Date: 15 Apr 2002 15:50:21
Message: <Xns91F1DE97AFC33seed7@povray.org>
in news:3CBB230A.1E027FE2@gmx.de Tim Nikias wrote:

> I've tracked the bug down to a
> vnormalize(<0,0,0>) used as a translation.
> 

From the doc:

vnormalize(A) Normalize vector A. Returns a unit length vector that is the 
same direction as A. Formula is vnormalize(A)=A/vlength(A). 
vnormalize(<0,0,0>) will not give a usefull result
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
Ingo


Post a reply to this message

From: Tim Nikias
Subject: Re: Vanish/Ghost/Killer bug
Date: 16 Apr 2002 00:29:33
Message: <3C92D851.CC58115B@gmx.de>
That's right, its in the docs. Though I think "not a useful result"
isn't something I'd expect to run loose on the entire
scene.

 Can't a default <0,1,0>, or better
(because we're dealing with a <0,0,0> vector) a
<0,0,0> be returned instead of some haywire?

Also, I didn't know that the reason for all this was
this vnormalize-issue, I thought it had something to
do with macros, because thats when it popped up
first with my Particle-System, and then with the
Gerbera.

ingo wrote:

>
> From the doc:
>
> vnormalize(A) Normalize vector A. Returns a unit length vector that is the
> same direction as A. Formula is vnormalize(A)=A/vlength(A).
> vnormalize(<0,0,0>) will not give a usefull result
>                          ^^^^^^^^^^^^^^^^^^^^^^^^^
> Ingo

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde


Post a reply to this message

From: ingo
Subject: Re: Vanish/Ghost/Killer bug
Date: 16 Apr 2002 02:04:27
Message: <Xns91F2529097941seed7@povray.org>
in news:3C92D851.CC58115B@gmx.de Tim Nikias wrote:

> That's right, its in the docs. Though I think "not a useful result"
> isn't something I'd expect to run loose on the entire
> scene.

I'll see what I can changein the text.

>  Can't a default <0,1,0>, or better
> (because we're dealing with a <0,0,0> vector) a
><0,0,0> be returned instead of some haywire?

I would prefer an error. While making mesh generation macros I've been 
bitten by this often. Investigation always showed that I did something 
wrong in my code with the result of a <0,0,0> vector. It always took a 
while to find the problems because POV-Ray just goes on parsing after a 
vnormalize(<0,0,0>).

 
> Also, I didn't know that the reason for all this was
> this vnormalize-issue, I thought it had something to
> do with macros, because thats when it popped up
> first with my Particle-System, and then with the
> Gerbera.
> 

Shows the importance of reducing the scene as much as possible ;)

Ingo


Post a reply to this message

From: Tim Nikias
Subject: Re: Vanish/Ghost/Killer bug
Date: 16 Apr 2002 13:38:32
Message: <3CBC61A0.9217A1ED@gmx.de>
How about returning <0,0,0> as value AND giving
a warning-message? As long as that vector is needed
for translation, an error might be fine, but in certain
cases, in certain POV-SDL-Code, you might do
thousands of calculations with vnormalize(), but only
one (due to some random input) may result with
vnormalize(<0,0,0>).
So, at least programming would be made easy.

Of course, the solution would be a macro, purposefully
named
VNormalize ( Vector ), which checks the length of the
vector (using vlength()), and if its !=0, you normalize,
otherwise, return a preffered value e.g. <0,0,0> or <0,1,0>.

That's what I'll probably do, because I believe this
bug is similiar to that strange pow() behaviour, and it may
be impossible and very inefficient to check for the
vnormalize(<0,0,0>) in POV itself (I think there a lot
of things which are done by POV because of inefficiency).

And regarding "reducing" the scene:
How about putting a section in the Docs which simply
state a list of "probably unexpected behaviour", which
cover pow(), vnormalize(), and I don't know what else
pops up? Just than one can check easily and fast.

ingo wrote something like:

> I would prefer an error. While making mesh generation macros I've been
> bitten by this often. Investigation always showed that I did something
> wrong in my code with the result of a <0,0,0> vector. It always took a
> while to find the problems because POV-Ray just goes on parsing after a
> vnormalize(<0,0,0>).
>

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Vanish/Ghost/Killer bug
Date: 17 Apr 2002 11:29:39
Message: <3cbd94e3@news.povray.org>
In article <Xns### [at] povrayorg> , ingo <ing### [at] homenl>  
wrote:

> From the doc:
>
> vnormalize(A) Normalize vector A. Returns a unit length vector that is the
> same direction as A. Formula is vnormalize(A)=A/vlength(A).
> vnormalize(<0,0,0>) will not give a usefull result

It will be an error in the next beta.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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