|
|
You can think about f_noise3d() (let's start speaking pov3.5, shall we?-) )
as a "random" number generator which returns values between 0 and 1, inclusive.
Of course it's not a random number generator, but you can think about it
as if it was.
This can be used, for example, to "randomly" vary the surface of your
function. For example suppose that you have a sphere of radius 10 defined
like this:
#declare MySphere = function { x^2+y^2+z^2-10^2 }
Now if you want to displace the surface of the sphere randomly you can
add noise to the radius:
#declare MySphere = function { x^2+y^2+z^2-(10+f_noise3d(x,y,z))^2 }
This will cause the radius to vary between 10 and 11 in different parts
of the sphere.
Of course the term "noise" is a bit misleading because it gives you smooth
transitions, not random noise, but you got the idea, didn't you?
You can adjust the frequency of this "noise" about any axis by modifying
the three parameters given to it. For example if you want noise that is
twice as dense in all directions, you can do it like:
#declare MySphere = function { x^2+y^2+z^2-(10+f_noise3d(x*2,y*2,z*2))^2 }
If you want less or more noise, you can multiply the return value of the
noise function. For example if you want half of the displacement, you can
do:
#declare MySphere = function { x^2+y^2+z^2-(10+0.5*f_noise3d(x*2,y*2,z*2))^2 }
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
|