POV-Ray : Newsgroups : povray.general : Weird rand() quirk? : Re: Weird rand() quirk? Server Time
13 Aug 2024 03:18:40 EDT (-0400)
  Re: Weird rand() quirk?  
From: Rainer Mager
Date: 13 Nov 1998 03:58:44
Message: <364bf4c4.0@news.povray.org>
Hi Margus,

    You're right, something very strange is going on here. I think it is a
bug. Even more odd is this. I inserted the following:

#render concat( "PS: <",
 str( PointStart.x, 2, 4 ), ", ",
 str( PointStart.y, 2, 4 ), ", ",
 str( PointStart.z, 2, 4 ), ">  ",
 "   PE:",
 str( PointEnd.x, 2, 4 ), ", ",
 str( PointEnd.y, 2, 4 ), ", ",
 str( PointEnd.z, 2, 4 ), ">  CS:",
 str( CurSegm, 2, 0 ), "\n" )

just inside your #while loop. If you check the output none of the number in
the X axis are off as show up in the picture. It very much appears to me
that the data displayed by the output from above is correct but the render
is wrong.

I also tried in your cone statement changing it to:

   cone {
    PointStart * <2,1,1> + <0,0,0.05>,
    RadStart,
    PointEnd  * <2,1,1>,
    RadEnd
    pigment { rgb <CurSegm / 5, 1, 1> }
   }

This seperates the segments a bit more for visibility and also amplifys the
phenomena. The VERY interesting thing is that if your change the X
amplification to a number much about 2, say 4, then it entirely disapears.
At 2 it is more visible than at 1 but at 4 it is gone entirely.

Further, I tried change the end #declare to this:

   #declare PointStart = PointEnd + <0,0, 0.05>;

When I did the the phenomena went away again. I'd tell the POV team. I have
no idea what is causing the bug. It is very hard to pin down where is comes
from. I don't think it is related to rand or seed after all.

Good luck,


--Rainer



Margus Ramst wrote in message <364B73CD.942FCB99@peak.edu.ee>...
>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?
>
>Thanx
>Margus


Post a reply to this message

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