POV-Ray : Newsgroups : povray.advanced-users : New random distribution macros : Re: New random distribution macros Server Time
24 Jun 2021 13:32:52 EDT (-0400)
  Re: New random distribution macros  
From: Bald Eagle
Date: 3 Mar 2021 07:05:01
Message: <web.603f7a4f296d8a3b1f9dae300@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:

> I am quite a heavy user of VRand_In_Obj() myself, and except for
> VRand_On_Sphere there are no other "ON" (flat) distributions available
> where objects are concerned. I wonder if your list of "ON" objects
> cannot be reduced by one single VRand_On_Obj() macro? At least where 3d
> objects are concerned?

Well, unless you have some insight into _how_ to accomplish that, where I will
once again go "oh - duh.  I should have seen that,"   then I think it's a bit
more complicated than that.

How do you "get to" the inside hole of a torus with such a method?
2 holes?  3?  42?
What if I have a bowl that I want to cover the _inside_ of with random points?

I think it goes back to all of the experiments where people have tried to
"meshify" objects using trace().   It's damned tricky.
But having pointed that out, maybe LeForgeron has some ideas about how to go
about it.

And then, as I discovered, after hunting down a curious line of code in Ingo's
vrand on sphere macro, that there's the matter of not just randomly placed - but
EVENLY placed.   The distributions can be quite tricky.

Lets say we take a landscape heightfield and try to place objects onto it.   If
we just trace() straight down from an imaginary rectangle of ray starting
coordinates, then the regions of rapidly changing elevation don't get as much
arc-length coverage as the flat parts.


> 2d objects are another kettle of fish I presume
> and it is certainly not out of iddleness that you mention them separately.

Yes, because there is no inside() to those things.

> I have used trace() combined with a VRand_ to put things'on' a given
> object, of whatever form, but your solution(s) would be more interesting
> indeed.

The problem that I see there is that you have to home-brew a coverage algorithm
to generate the start and direction vectors for trace to use, and probably have
a fair number of rejected hit-or-miss test rays.

For specific well-defined surfaces, it seemed better to have all of the random
points picked already be 100% valid.

> Usefull are also any gaussian distributions 'in' or 'out' of a surface
> or object. I have a couple of examples I need to dig up....(added here)
> maybe you can use them...

I'll give them a look - thanks   :)


Post a reply to this message

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