POV-Ray : Newsgroups : povray.newusers : loop 'falling over' : Re: loop 'falling over' Server Time
28 Jul 2024 14:28:26 EDT (-0400)
  Re: loop 'falling over'  
From: Graham
Date: 23 Jan 2009 08:15:01
Message: <web.4979c1ec166d13c07fae05f50@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> Your inner loop is looping forever.
> If you add:
>   #debug concat("SizInt: ",str(SizInt,3,3),"\n")
> to the end of your inner loop you'll see that it never reaches the end
> condition where SizInt>=6, so it keeps going.
>
> I don't think the min_extents and max_extents functions are doing exactly
> what you think they're doing because I believe these work more on bounding
> boxes of the intersecting objects than on the actual bits of space occupied
> by the parts of the object. As soon as the bounding box from the union of
> dice fills the cylinder your condition therefore fails to end the loop, even
> though there's space available between the existing dice. ie it can't find a
> position where the bounding boxes don't intersect.
>
> You're probably better off recording the centre positions of the dice in an
> array and looping through the array to see if the centre to centre distance
> of the next dice from each existing dice is large enough to avoid
> collisions.
>
> Regards,
> Chris B.

Thanks Chris,
  That was what I was hoping to avoid, but I've done it, and I'm happy with the
results. Basically having fun with wood, chrome and glass, particularly a
convex/concave meeting of chrome and glass, and the interplay of a bright
burning sun. Here is the immediate result:
http://au.geocities.com/gjdolby/jpgs/pillar_20.jpg and here is the evolution:
http://au.geocities.com/gjdolby/gifs/yahtzee.gif

Regards, Graham


Post a reply to this message

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