POV-Ray : Newsgroups : povray.advanced-users : Randomizing pattern functions : Randomizing pattern functions Server Time
28 Jul 2024 20:28:52 EDT (-0400)
  Randomizing pattern functions  
From: Dan P
Date: 5 Jan 2004 21:51:01
Message: <3ffa2295@news.povray.org>
I'm attempting to generate a macro that spits out an isosurface that
generates a boulder depending upon a seed. Then, I will take and write a
macro that spits them all out on a grid so that I can pick and choose from a
contact sheet.

I figured that translating a pattern would be like translating a pigment and
that randomly translating it's position would give me different forms.
However, I can't pass another parameter to a pattern function, so I'm not
sure how to get the translation inside of the pattern{} block.

Has anyone tried this kind of thing? Thanks!

-- >8 Code --

#declare f_rock1_1  =
function
{
 pattern
 {
  wrinkles
 }
}



#declare f_rock1_2  =
function
{
 pattern
 {
  bozo
 }
}



#macro rock1 (n)

 #declare R_ROCK1 = seed(n);

 isosurface
 {
  function { (f_sphere (x, y, z, 1) + f_rock1_1(x, y, z) + f_rock1_2(x, y,
z) ) / 3 }
  max_gradient 5
  evaluate 5, 1, 0.2

  #ifdef (DRAFT)
   accuracy 0.1
  #end

  #ifndef (DRAFT)

   pigment
   {
    granite

    color_map
    {
     [0 rgb <0.7, 0.7, 0.7> ]
     [1 White ]
    }

    translate <rand(R_ROCK1), rand(R_ROCK1)>
   }

  #else

   pigment { color White }

  #end
 }

#end

-- 
- Respectfully,
Dan

"When it is not in our power to follow what is true,
we ought to follow what is most probable."
                                         - Rene Descartes


Post a reply to this message

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