POV-Ray : Newsgroups : povray.binaries.images : pattern ideas : pattern ideas Server Time
14 Nov 2024 22:21:39 EST (-0500)
  pattern ideas  
From: ingo
Date: 30 Oct 2003 13:08:42
Message: <Xns9424C2BAB2646seed7@netplex.aussie.org>
This is related to the posting:

Newsgroups: povray.unofficial.patches
Subject: pattern ideas
From: ingo <ing### [at] tagpovrayorg>
Message-ID: <Xns### [at] netplexaussieorg>
Date: 28 Oct 2003 13:58:36 -0500
Xref: news.povray.org povray.unofficial.patches:8969

I tried to visualise one of the ideas of the posting mentioned above.
The first images shows the difference of a plane with spheres. The 
spheres have a 'spherical' pattern and the 'cutaway_textures' keyword 
makes it show.

The first image shows the result when the spheres are randomly 
positioned within a 1x1x1 unit box. The radius of the speres is equal to 
the minimum distance to the wall of the box, measured from the random 
point. Actually this 'pattern' looks less exciting than I imagined. This 
may be caused by the amount of small spheres, so ....

... the second image was created. Here a Gauss distribution, around the 
center of the box, is used, instead of complete randomness. Also all 
'spheres' are put on z=0.5, no randomness here. The standard deviation 
of the distribution is set with the second parameter in the Rand_Gauss 
macro.

To show something (simple) that could be done with such a pattern, the 
third example is attached. Here only the color_map is changed. Other 
things I tried is using a radial pattern (rotated 90*x) and a 'boxed' 
pattern. Both with and without the color_map. The scene below is easy to 
change, so no images of the latter two.


---%<---%<---%<---

#version 3.5;
#include "rand.inc"
global_settings {assumed_gamma 1.0}

#declare Spheres = union {
  #declare Seed=seed(7);
  #declare DimX=15;
  #declare DimY=15;
  #declare DimZ=1;
  #declare I=0;
  #while (I<DimX)
    #declare J=0;
    #while (J<DimY)
      #declare K=0;
      #while (K<DimZ)
        #declare Centeroid=<rand(Seed),rand(Seed),rand(Seed)>;
        /*#declare Centeroid=<Rand_Gauss(0.5, 0.15, Seed),
                            Rand_Gauss(0.5, 0.15, Seed),
                            Rand_Gauss(0.5, 0.0, Seed)>;*/
        #declare Rx=0.5-abs(Centeroid.x-0.5);
        #declare Ry=0.5-abs(Centeroid.y-0.5);
        #declare Rz=0.5-abs(Centeroid.z-0.5);
        #if (Rx <= Ry )
          #declare Radius = Rx;
        #else
          #declare Radius = Ry;
        #end
        #if (Rz < Radius)
          #declare Radius = Rz;
        #end
        sphere {
          0,1
          pigment {
            spherical 
            /*colour_map {
              [0.2, rgb 0]
              [0.2, rgb 1]
              [0.6, rgb 1]
              [0.6, rgb 0]
            }*/
          }
          scale Radius
          translate Centeroid+<I,J,K>
        }
        #declare K=K+1;
      #end    
      #declare J=J+1;
    #end
    #declare I=I+1;
  #end
}

difference {
  object {Spheres translate <0,0,-0.5>}
  union {
    box {<-DimX,-DimY,-DimZ>,<DimX,DimY,0>}
    box {<-DimX,-DimY,0.0001>,<DimX,DimY,DimZ>}
  }
  bounded_by{box{<0,0,0>,<DimX,DimY,0.0001>}}
  cutaway_textures
}

camera {
  location  <DimX/2, DimY/2, -400>
  right     x*image_width/image_height
  look_at   <DimX/2, DimY/2,  0.0>
  angle 2.5
} 

light_source {<0,0, -300>  rgb 1} 

---%<---%<---%<---

Ingo


Post a reply to this message


Attachments:
Download 'rnd_leopard_03.png' (20 KB) Download 'rnd_leopard_02.png' (53 KB) Download 'rnd_leopard_01.png' (11 KB)

Preview of image 'rnd_leopard_03.png'
rnd_leopard_03.png

Preview of image 'rnd_leopard_02.png'
rnd_leopard_02.png

Preview of image 'rnd_leopard_01.png'
rnd_leopard_01.png


 

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