POV-Ray : Newsgroups : povray.general : Weird rand() quirk? : Re: Weird rand() quirk? Server Time
13 Aug 2024 03:20:10 EDT (-0400)
  Re: Weird rand() quirk?  
From: Chris Colefax
Date: 17 Nov 1998 02:09:13
Message: <36512115.2EACAB15@geocities.com>
Margus Ramst wrote:
> 
> OK, this is weird...
> This macro seems to exhibit a strange bug: when the random number seed is set to
1322 or 1342 (as far as I've discovered) the 3rd segment of the "worm" gets
misaligned. The misalignment grows with the total number of segments. I can't find any
errors in my code...
> Could sb. try it out and tell me if I'm just being stupid or is this a genuine bug?
> 
[buggy scene snipped]

Yes, the problem certainly is strange, and no - there are no problems in
your code.  A little testing reveals that the problem is related to the
cones you are trying to render, and in particular a cone with similar
values to these:

   cone {<-0.020957, 0, 0>, 0.299520, <-0.021942, 0, 1>, 0.298920}

which can be reduced to:

   cone {<0, 0, 0>, 100, <4, 0, 1000>, 99}

Rendering this cone reveals a shift in the -x direction that should
definitely not be there.  Making the start and end radii equal (so that
POV-Ray converts the cone into a cylinder) removes the problem, but
otherwise the smaller the difference between the two values, the greater
the shift.  Also, increasing the offset of the start and end points
beyond a certain value will remove the problem (a factor of about 4/1000
in any direction seems to give the maximum shift).  The problem affects
POV-Ray 3.1a, 3.1, and 3.00e, so you can probably feel quite jusitified
in reporting it as a bug...


Post a reply to this message

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