POV-Ray : Newsgroups : povray.advanced-users : Direct stochastic tiling : Re: Direct stochastic tiling Server Time
27 Jul 2024 08:06:25 EDT (-0400)
  Re: Direct stochastic tiling  
From: Bald Eagle
Date: 22 Sep 2023 19:55:00
Message: <web.650e28ed5bb87ec31f9dae3025979125@news.povray.org>
Alrighty.

I managed to work through a bunch of the code and twiddle this and that until I
got it to "work" and pretty much fill the screen with selected points.

The first issue that I ran into was that I was doing some kind of "screen size
math" which was just messing everything up, so I'm just using the whole image
resolution.

Then I managed to get a bunch of cycles to function, but the algorithm would
exit early - sometimes after only 7 cycles.

I added some logic to break out of the nested loops, and then I expanded the
neighbor search to a 5x5 grid, as suggested/explained/illustrated by Sebastian
Lague.

It still runs forever without a bailout value set, instead of exhausting the
Active array and properly exiting the macro.

Finally, the points are clustered much too closely - I ought to be able to draw
circles with radius R that don't overlap, and the attached image is using
circles that are only R/4.

Clearly POV-Ray is very different than Javascript or C#, or I'm really in a long
stretch of brain-fry or code blindness and am missing something very simple but
utterly crucial.

- BW


Post a reply to this message


Attachments:
Download 'poisson-disc sampling.pov.txt' (7 KB)

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