POV-Ray : Newsgroups : povray.general : Slightly faster VRand_On/In_Sphere() : Re: Slightly faster VRand_On/In_Sphere() Server Time
4 Aug 2024 02:19:23 EDT (-0400)
  Re: Slightly faster VRand_On/In_Sphere()  
From:
Date: 12 Nov 2003 23:37:57
Message: <3fb30aa5$1@news.povray.org>
Oh boy, what a long thread ...

I've not looked at this thread for a while and I am astonished
about the many responses (and strange sidetracks ...). Next time
when I post such a thing I will provide a proof together with it,
but here it seems unneccessary now as Wolfgang did it (thanks for
that).

Because the usage of such a macro should not depend on its inner
workings, I think it is bad (or at least questionable) programming
style to rely on the specific algorithm used for the implementation.
(Remember: the macro is supposed to deliver *random* points, so
even a truly random hardware generator that never repeats the same
(long) sequence should be accepted!)
If this dependence is required, the macro should be *copied* to the
scene: this will prevent these special scenes from breaking while
leaving room for improvements for the majority of the other scenes.
(BTW: calling a copied macro is *much* faster than calling an
included macro, when it is used very often.)
Refraining from such improvements sounds to me a little bit like
"don't improve the accuracy of POV-Ray's geometric calculations,
my scene depends on the rounding errors". (O.K., don't take this
argument toooo seriously: I wrote "to me" and "a little bit" :-)

So I now suggest to use the new macros in rand.inc, but leave
the old macros as comment (or renamed to ..._Old).
Or: leave the old macros and include my macros with the suffix
"_New" or as comment ...

   Sputnik


Post a reply to this message

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