POV-Ray : Newsgroups : povray.binaries.images : A Question : Re: A Question Server Time
30 Jul 2024 20:19:55 EDT (-0400)
  Re: A Question  
From: Anthony D  Baye
Date: 18 Jan 2011 13:05:00
Message: <web.4d35d580a5aa5444d7f39bd00@news.povray.org>
"Samuel Benge" <stb### [at] hotmailcom> wrote:
> Ack, there was a glaring error with the code I posted. Here's a fully-working
> version (c:
>
> /*
>
>   basalt.pov
>
>   2011 Samuel Benge
>
>   A quick basalt height map generator. Render with +rng or hf_gray_16
>
> */
>
> #include "functions.inc"
> #include "math.inc"
>
>
> // user variables
>
> #declare N_Rows = 20;          // this determines the number of columns
> #declare N_Extra_Columns = 0; // how many columns to randomly add
> #declare Jitter    = .5;    // makes everything a bit more natural
>
> #declare Height_Function = // your height function here
>   function{
>     f_ridged_mf(x*3, y*3, z*3, 0.6, 3, 7, 0.7, 0.7, 2)
>   }
>
> // ~user variables
>
>
> #default{ finish{ ambient 1 } }
>
> camera{
>  orthographic
>  right x*2 up y*2
>  location -z*10
> }
>
> union{
>   #declare R = seed(1001);
>   #declare Z = -int(N_Rows*1.4/2);
>   #while(Z<=int(N_Rows*1.4/2))
>     #declare X = -int(N_Rows/2);
>     #while(X<=int(N_Rows/2))
>       cone{0,0,-y,2/N_Rows
>         #local Vec =
>           <
>             X+odd(Z)/2+rand(R)*Jitter,
>             0,
>             Z+rand(R)*Jitter
>           >/N_Rows*<1,1,sin(pi*2/3)>*2;
>         #declare XV = Vec.x;
>         #declare ZV = Vec.z;
>         translate Vec
>         pigment{rgb Height_Function(XV,0,ZV).x}
>       }
>       #declare X=X+1;
>     #end
>     #declare Z=Z+1;
>   #end
>
>   // extra columns
>   #declare V=0;
>   #while(V<N_Extra_Columns)
>     cone{0,0,-y,2/N_Rows
>       #local Vec = <-1+rand(R)*2, 0, -1+rand(R)*2>;
>       #declare XV = Vec.x;
>       #declare ZV = Vec.z;
>       translate Vec
>       pigment{rgb Height_Function(XV,0,ZV).x}
>     }
>     #declare V=V+1;
>   #end
>   rotate x*270
> }
>
> // ~basalt.pov

Looks like a cells pattern to me.  Basalt is crystalline, and I've noticed from
looking at photos that the fracture tends to be either hexagonal or cubic.

I'm currently working on modifying my original pigment so that the greyscale
values for certain ranges are determined by my hex-tile function.

A.D.B.


Post a reply to this message

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