POV-Ray : Newsgroups : povray.advanced-users : Mandelbrots, Rand, and maybe more... : Re: Mandelbrots, Rand, and maybe more... Server Time
30 Jul 2024 14:30:57 EDT (-0400)
  Re: Mandelbrots, Rand, and maybe more...  
From: Margus Ramst
Date: 29 May 1999 13:11:09
Message: <3750119d.0@news.povray.org>
Ken wrote in message <374F6CCC.82E06A57@pacbell.net>...
>
>
>Mandelbrot:
>

Well, I'm not sure, but here's a guess: it's basically a subdivision
fractal, i.e. its dimendions approach a certain limit. It does not stretch
into ifinity - much like the spherical pattern. It should be possible to
make Mandelbrots tiling into infinity - but in the source code, not in a
script.

>
>
>Rand:
>


Rand has a mean of 0.5 and a maximum deviation of 0.5 so it can be from 0 to
1.  Here are a few rand() macros you might find useful (I'll probably post
my entire macro collection sometime soon)

//return 1 with the likelyhood of P (from 0 to 1)
//otherwise return 0
#macro Chance(P,Seed)
    #local R=abs(rand(Seed)-.5)*2;
    (#if(R>=(1-P)) 1 #else 0 #end)
#end

//Create random number of given mean and maximum deviation
//M - mean value
//D - maximum deviation
//Seed - (declared) random number seed identifier
#macro rand_ext(M,D,Seed)
        (M+(rand(Seed)-.5)*2*D)
#end

//Give a random vector of given mean and max deviation
//M - mean (vector/float)
//D - max deviation (vector/float)
//Seed - (declared) random number seed identifier
#macro v_rand_ext(M,D,Seed)
        #local MV=M+<0,0,0>;
        #local DV=D+<0,0,0>;
        (<rand_ext(MV.x,DV.x,Seed),
           rand_ext(MV.y,DV.y,Seed),
           rand_ext(MV.z,DV.z,Seed)>)
#end

>
>Array question(s):
>

The "Unit problem"... Is that indenting I see?! Well, another speculation.
The Unit object is not assigned the new construct until the script breaks
out of the loop; until then the old Unit is referenced.
Anyway, if it works, why worry?
And AFAIK, #local is meant for macros and include files. I don't think it
separates nested conditional levels.

As for your array example, all seems correct. I'm not sure how large an
array dimension can be, but I've gone pretty high. Perhaps it's only limited
by available memory. The number of dimensions is limited to 5, though. And
5-dimensional arrays become very large very quickly (remember, all array
elemenst become initialized once you declare one element).

Margus


Post a reply to this message

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