POV-Ray : Newsgroups : povray.binaries.images : A Question Server Time
30 Jul 2024 18:20:53 EDT (-0400)
  A Question (Message 1 to 8 of 8)  
From: Anthony D  Baye
Subject: A Question
Date: 13 Jan 2011 19:15:00
Message: <web.4d2f94d43aa0723ad7f39bd00@news.povray.org>
I'm working on a concept for a shoreline backed by Basalt columns. I'm using a
randomly tiled hexagonal pattern function with a height field and multiplying it
by f_ridged_mf

The problem I'm having is that the tops of the columns should be flat, not
slanted, so that the base offset follows the contour of f_ridged_mf, but their
height does not.

Not sure if that makes sense.

the code is as follows, Image attached at bottom.

#include "kolors.inc"
#include "functions.inc"

light_source { 1e4 1 }

camera { location 60 look_at 0 }

#declare pigA=pigment { cells
   warp { repeat z offset <-.5,10,0>}
   translate z/2
   scale <3,1,sqrt(6.75)>
}
#declare pigB=pigment { cells
   warp { repeat z offset <-.5,10,0>}
   translate <1.5,7,0>
   scale <3,1,sqrt(6.75)>
}
#declare pigC=pigment { cells
   warp { repeat z offset <-.5,10,0>}
   translate <0,-7,0>
   scale <3,1,sqrt(6.75)>
}

#declare basaltColumns =
function {
     pigment {
          hexagon
          pigment { pigA },
          pigment { pigB },
          pigment { pigC }
          rotate 90.0*x
          }
     }

sky_sphere {
     pigment {
          function { abs(y) }
          color_map {
               [0.0 rgb 1 ]
               [0.1 SkyBlue ]
               [1.0 SkyBlue ]
               }
          }
     }
/*
isosurface {
     function { y - 3.0 * basaltColumns(x,y,z).y }
     max_gradient 5206
     threshold 0
     contained_by { box { -5, 5 } }
          pigment { rgb 1 }
          finish { ambient 0.2 diffuse 0.6 }
     }*/
// f_ridged_mf(x,y,z, 0.1, 3, 7, 0.7, 0.7, 2)

object {
     height_field {
          function 512, 512 { f_ridged_mf(x*3,y*3,z*3, 0.6, 3, 7, 0.7, 0.7, 2)
                              * basaltColumns(x*60,y*60,z*60).y }
//          water_level 0.15
          }
     translate <-0.5, 0.0, -0.5>
     scale <100, 20, 100>
     pigment { White }
     }

Any advice would be appreciated.

Regards,
A.D.B.


Post a reply to this message


Attachments:
Download 'hextile.png' (341 KB)

Preview of image 'hextile.png'
hextile.png


 

From: Alain
Subject: Re: A Question
Date: 13 Jan 2011 21:51:59
Message: <4d2fba4f@news.povray.org>

> I'm working on a concept for a shoreline backed by Basalt columns. I'm using a
> randomly tiled hexagonal pattern function with a height field and multiplying it
> by f_ridged_mf
>
> The problem I'm having is that the tops of the columns should be flat, not
> slanted, so that the base offset follows the contour of f_ridged_mf, but their
> height does not.
>
> Not sure if that makes sense.
>
> Any advice would be appreciated.
>
> Regards,
> A.D.B.
>

For that, I'd use an hexagonal prism, modeled as a mesh, that is tilled 
with various vertical scales dictated by your function.

The mesh is to reduce the memory use and will render much faster than 
the isosurface version.



Alain


Post a reply to this message

From: Anthony D  Baye
Subject: Re: A Question
Date: 14 Jan 2011 03:10:01
Message: <web.4d300482a5aa54441a86e02e0@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:

> > I'm working on a concept for a shoreline backed by Basalt columns. I'm using a
> > randomly tiled hexagonal pattern function with a height field and multiplying it
> > by f_ridged_mf
> >
> > The problem I'm having is that the tops of the columns should be flat, not
> > slanted, so that the base offset follows the contour of f_ridged_mf, but their
> > height does not.
> >
> > Not sure if that makes sense.
> >
> > Any advice would be appreciated.
> >
> > Regards,
> > A.D.B.
> >
>
> For that, I'd use an hexagonal prism, modeled as a mesh, that is tilled
> with various vertical scales dictated by your function.
>
> The mesh is to reduce the memory use and will render much faster than
> the isosurface version.
>
>
>
> Alain

Yeah... Not sure what you have in mind, but I couldn't figure out anything that
looked remotely right.

I realize there are going to be problems with the height_field approach, not the
least of which are the vertical striations in the columns, I would like to use
your approach.  (although I might use a csg hex tile)

I could create caves this way.

the thing I like about the hf approach is that I could conceivably create a
pigment function that contains multiple sub-patterns using pigment_map (Basalt
columns turning into black sand, for instance.)

I'm quite at a loss...  What I'd like to do, ultimately is a shoreline of basalt
columns and outcroppings fading into green hills inland, which is why I was
using the height_field.  I tried using an isosurface, but the max_gradient was
way too high. (over 5000)

Regards,

A.D.B.


Post a reply to this message

From: Alain
Subject: Re: A Question
Date: 14 Jan 2011 12:25:49
Message: <4d30871d@news.povray.org>

> Alain<aze### [at] qwertyorg>  wrote:

>>> I'm working on a concept for a shoreline backed by Basalt columns. I'm using a
>>> randomly tiled hexagonal pattern function with a height field and multiplying it
>>> by f_ridged_mf
>>>
>>> The problem I'm having is that the tops of the columns should be flat, not
>>> slanted, so that the base offset follows the contour of f_ridged_mf, but their
>>> height does not.
>>>
>>> Not sure if that makes sense.
>>>
>>> Any advice would be appreciated.
>>>
>>> Regards,
>>> A.D.B.
>>>
>>
>> For that, I'd use an hexagonal prism, modeled as a mesh, that is tilled
>> with various vertical scales dictated by your function.
>>
>> The mesh is to reduce the memory use and will render much faster than
>> the isosurface version.
>>
>>
>>
>> Alain
>
> Yeah... Not sure what you have in mind, but I couldn't figure out anything that
> looked remotely right.
>
> I realize there are going to be problems with the height_field approach, not the
> least of which are the vertical striations in the columns, I would like to use
> your approach.  (although I might use a csg hex tile)
Using CSG is correct, but you won't benefit from the instantiation you 
get with meshes, resulting in a increased memory useage.
>
> I could create caves this way.
>
> the thing I like about the hf approach is that I could conceivably create a
> pigment function that contains multiple sub-patterns using pigment_map (Basalt
> columns turning into black sand, for instance.)
>
> I'm quite at a loss...  What I'd like to do, ultimately is a shoreline of basalt
> columns and outcroppings fading into green hills inland, which is why I was
> using the height_field.  I tried using an isosurface, but the max_gradient was
> way too high. (over 5000)
>
> Regards,
>
> A.D.B.
>

In real life, those columns don't "fade" into some other features, they 
get covered up with the other features.
So, you can have a hightfield for your sandy area at the base, and 
another for the grassy regions.



Alain


Post a reply to this message

From: Christian Froeschlin
Subject: Re: A Question
Date: 16 Jan 2011 19:26:57
Message: <4d338cd1@news.povray.org>
Anthony D. Baye wrote:

> I'm working on a concept for a shoreline backed by Basalt columns. I'm using a
> randomly tiled hexagonal pattern function with a height field and multiplying it
> by f_ridged_mf
> 
> The problem I'm having is that the tops of the columns should be flat, not
> slanted, so that the base offset follows the contour of f_ridged_mf, but their
> height does not.

I think you you could achieve that by slightly modifying your
code to produce two function definitions that are then combined
using the max function. The exact definitions will depend on
the intended result (e.g., should the height of a column be
constant or depend on the (average) height of the ground?


Post a reply to this message

From: Samuel Benge
Subject: Re: A Question
Date: 17 Jan 2011 18:00:01
Message: <web.4d34c923a5aa5444a6fdb2bc0@news.povray.org>
"Anthony D. Baye" <Sha### [at] spamnomorehotmailcom> wrote:
> I'm working on a concept for a shoreline backed by Basalt columns. I'm using a
> randomly tiled hexagonal pattern function with a height field and multiplying it
> by f_ridged_mf
>
> The problem I'm having is that the tops of the columns should be flat, not
> slanted, so that the base offset follows the contour of f_ridged_mf, but their
> height does not.
>
> Any advice would be appreciated.

Hi Anthony,

You can use an array of cones to produce the needed topology for your basalt. It
will need to be rendered as a height map beforehand. Here's a quick idea that
might help you on your quest:

/*

  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    = 0.2;    // 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,z,1/N_Rows
      #local Vec = <-1+rand(R)*2, -1+rand(R)*2, 0>;
      #declare XV = Vec.x;
      #declare YV = Vec.y;
      translate Vec
      pigment{rgb Height_Function(XV,YV,0).x}
    }
    #declare V=V+1;
  #end
  rotate x*270
}

// ~basalt.pov

The edges of each column will still produce artifacts, but you can overcome this
to some degree by blurring the 16-bit gray scale image. I've provided a scene
file for blurring an image. It's over at p.t.scene-files and is called
"blurResample.pov."

http://news.povray.org/povray.text.scene-files/thread/%3C4d34c72d%40news.povray.org%3E/

I hope that helps!

Sam


Post a reply to this message

From: Samuel Benge
Subject: Re: A Question
Date: 17 Jan 2011 18:15:01
Message: <web.4d34cca5a5aa5444312f6b340@news.povray.org>
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


Post a reply to this message

From: Anthony D  Baye
Subject: Re: A Question
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.