POV-Ray Raytracer Descriptions and Examples by Friedrich A. Lohmüller
   Random with POV-Ray (Part 7)
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorial

 Random in POV-Ray
   - RandomNumbers in Loops
   - quadratic + cubic
   - Colors + Scale
   - Tilting + Bending
   - Trees by Random
   - Include File 'rand.inc'
  > Filled height_field
   - Random Flower

  - Insert Menu Add-on
    & Download
 
                                       
  Filled height_field with 'rand.inc'      

  For this scene we are using the following function:
 VRand_In_Obj(Object, Stream)
 The vector to a random point inside an arbitrary object.

#declare Mountain  =
height_field{
  png "Mount1.png"
  smooth double_illuminate
  // file types:
  //gif|tga|pot|png|pgm|ppm|jpeg|tiff|sys
  //[water_level N]//  (0.0 ... 1.0)
  translate<-0.5,-0.001,-0.5>
  rotate<0,-110,0>
  scale<50,12,40>
  texture{
    pigment{ color rgb<1,0.95,0.8> }
    normal { bumps 0.75 scale 0.025 }
    finish { phong 0.1 }
  } // end of texture
  translate<2,0,30>
} // end of height_field ----------------
//---------------------------------------
#include "rand.inc" // random functions
#declare Random_1 = seed (12433);
//---------------------------------------
//---------------------------------------
union{
 #local Nr = 0;     // start
 #local EndNr = 4000; // end
 #while (Nr < EndNr)

  sphere{
    <0,0,0>, 0.80
    translate
      VRand_In_Obj( Mountain, Random_1)
    texture{
      pigment{ color rgb<0.6,0.05,0.1>}
      finish{ phong 1 reflection{0.15}}
    } // end of texture
  } // end of object

 #local Nr = Nr + 1;  // next Nr
 #end // ----------- end of loop

rotate<0,-20,0>
translate<10,0,0>
} // end of union
//---------------------------------------
See scene file for more details!
The height_field 'Mount1'
VRand_in_Object with height_field
Scene file for POV-Ray:  
VRand_in_Object_Hf.pov
   
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8
top

© Friedrich A. Lohmüller, 2013
www.f-lohmueller.de