|
 |
"Zeger Knaepen" <zeg### [at] student kuleuven ac be> schrieb im Newsbeitrag
news:3d6bde5e@news.povray.org...
> > > I was trying to do focalblur by averaging different renders earlier this
> day. I
> > > came up with the following formula to scatter points inside a regular
> polygon:
> > >
> > > #declare Seed=seed(whatever);
> > > #declare angles=<insert number of angles here>;
> > > #declare Rot=360*rand(Seed);
> > > #declare X=pow(rand(Seed),.5);
> > > #declare Rot2=Rot/(360/angles);
> > > #declare fraqrot=Rot2-int(Rot2);
> > > #declare fraqrot2=abs(fraqrot-.5);
> > > #declare fraqrot3=pow(fraqrot2*2,.5);
> > > #declare Location=vrotate(x*X*(.8+.2*fraqrot3),Rot*z);
> >
> > probably right....
> > but please compare these lines to the simple way of determing a single
point
> > in an rectangle concerning the time it takes to compute it ...
> >
> > ... and then take into account, that this has to been done multiple times
> > per pixel ... Maybe its ok to precompute ~2^10 such values and store them
> > in a table, so you can reuse them later ... but I'm not sure this will
help
> Yes, a rectangle, or a circle, will be faster, that's why you should have
the
> option to use a circle (or a rectangle, but I don't think that would give
> realistic results actually).
>
Hi,
why not just make a circular pattern by generating the Points like before
in a rectangular area and then testing [x^2+y^2 > Radius] for the Point
to find out if it lies in the Circle. If the Condition is True, just generate
another Point until it's inside the Circle. This is a common and fast way to
get circular Points.
Greetings,
Thies
Post a reply to this message
|
 |