POV-Ray : Newsgroups : povray.pov4.discussion.general : Height_fields and using wave modifiers. Server Time
22 Feb 2024 06:11:56 EST (-0500)
  Height_fields and using wave modifiers. (Message 1 to 5 of 5)  
From: William F Pokorny
Subject: Height_fields and using wave modifiers.
Date: 14 Feb 2023 12:50:39
Message: <63ebc9ef$1@news.povray.org>
In povray.general there's been a recent discussion on using functions to 
define height fields on the fly. I had the thought height_fields a good 
way to see how wave modifiers and warps can be used to change up 
patterns and 'terrain' too.

Attached is an image of 8 height_fields based upon a based on the 
granite pattern. Seven use only wave modifiers to change up the terrain. 
One uses a warp of directional turbulence.

Posting in this pov4 forum due using a couple of povr specific wave 
modifier updates. The ideas apply to official POV-Ray releases too.

Bill P.



// The core code for reference.
#declare FnBase    = function { pattern {
        	granite scale 0.7
         warp {
	turbulence <0.25,0.05,0> octaves 4 omega 0.6 lambda 2.3
	}
	}
     }
#declare FnCubic   = function { pattern {
         // Povr's cubic_wave changed from POV-Ray's
         granite cubic_wave phase 0.3 frequency 1.77 scale 0.7 }
     }
#declare FnSine    = function { pattern {
         granite sine_wave scale 0.7 }
     }
#declare FnScallop = function { pattern {
         granite scallop_wave scale 0.7 }
     }
#declare FnTri     = function { pattern {
         granite triangle_wave scale 0.7 }
     }
#declare FnTriInv  = function { pattern {
         // Povr added an inverse wave modifier
         granite triangle_wave inverse scale 0.7 }
     }
#declare FnPoly2_0 = function { pattern {
         granite poly_wave 2.0 scale 0.7 }
     }
#declare FnPoly0_2 = function { pattern {
         granite poly_wave 0.2 scale 0.7 }
     }
//---------
#declare Orange = srgb <1,0.50196,0>;
#declare HF_Base = height_field {
     function 800, 800 { FnBase(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.05,1>
     pigment { color Orange }
}
#declare Acorn = srgb <0.41569,0.36471,0.10588>;
#declare HF_Cubic = height_field {
     function 800, 800 { FnCubic(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.05,1>
     pigment { color Acorn }
}
#declare Akaroa = srgb <0.83137,0.76863,0.65882>;
#declare HF_Sine = height_field {
     function 800, 800 { FnSine(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.05,1>
     pigment { color Akaroa }
}
#declare Alpine = srgb <0.68627,0.56078,0.17255>;
#declare HF_Scallop = height_field {
     function 800, 800 { FnScallop(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.05,1>
     pigment { color Alpine }
}
#declare Amazonite = srgb <0,0.76863,0.6902>;
#declare HF_Tri = height_field {
     function 800, 800 { FnTri(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.05,1>
     pigment { color Amazonite }
}
#declare AndroidGreen = srgb <0.64314,0.77647,0.22353>;
#declare HF_TriInv = height_field {
     function 800, 800 { FnTriInv(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.05,1>
     pigment { color AndroidGreen }
}
#declare Apricot0 = srgb <0.92157,0.57647,0.45098>;
#declare HF_Poly2_0 = height_field {
     function 800, 800 { FnPoly2_0(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.05,1>
     pigment { color Apricot0 }
}
#declare AppleBlossom = srgb <0.68627,0.30196,0.26275>;
#declare HF_Poly0_2 = height_field {
     function 800, 800 { FnPoly0_2(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.05,1>
     pigment { color AppleBlossom }
}
//---------
#declare Union00 = union {
     object { HF_Base }
     object { HF_Cubic   translate <-1.0,0,0>}
     object { HF_Sine    translate <-0.5,0,1> }
     object { HF_Scallop translate <-2.0,0,-0.5> }
     object { HF_Tri     translate <-1.0,0,-1> }
     object { HF_TriInv  translate <0,0,-1> }
     object { HF_Poly2_0 translate <-0.5,0,-2>}
     object { HF_Poly0_2 translate <1,0,-0.5> }
}


Post a reply to this message


Attachments:
Download 'hf_wavemods.jpg' (267 KB)

Preview of image 'hf_wavemods.jpg'
hf_wavemods.jpg


 

From: yesbird
Subject: Re: Height_fields and using wave modifiers.
Date: 14 Feb 2023 13:25:00
Message: <web.63ebd1b2a634f98a68fd655b10800fb2@news.povray.org>
Nice ! Got it and put to my collection, but

> granite triangle_wave inverse scale 0.7 }

gives parsing error (on 3.7 and 3.8) - "inverse" is the reason.
--
YB


Post a reply to this message

From: William F Pokorny
Subject: Re: Height_fields and using wave modifiers.
Date: 14 Feb 2023 13:31:56
Message: <63ebd39c$1@news.povray.org>
On 2/14/23 13:23, yesbird wrote:
> Nice ! Got it and put to my collection, but
> 
>> granite triangle_wave inverse scale 0.7 }
> 
> gives parsing error (on 3.7 and 3.8) - "inverse" is the reason.
> --
> YB
> 
:-) Yes, inverse as a wave modifier is a povr fork extension and a 
proposed idea for v4.0 (though yep that v4.0 bit of pipe dream at the 
moment).

Delete it to run on regular releases.

Note povr's cubic_wave is also different, but it should run as coded - 
it'll look a little different.

Bill P.


Post a reply to this message

From: yesbird
Subject: Re: Height_fields and using wave modifiers.
Date: 14 Feb 2023 13:55:00
Message: <web.63ebd8cba634f98a68fd655b10800fb2@news.povray.org>
> Attached is an image of 8 height_fields based upon a based on the
> granite pattern.

This is a royal gift ! Can't stop playing with them:
------------------------------------------------------
#include "colormaps.inc" // From here: https://github.com/syanenko/colormaps

#version 3.8;
global_settings { assumed_gamma 1 }


camera
{ location <1,1,1> * 2
  look_at <0,0,0>
  angle 50
}


light_source { <10,10,10>, rgb <1,1,1> }


// The core code for reference.
#declare FnBase    = function { pattern {
         granite scale 0.7
         warp {
 turbulence <0.25,0.05,0> octaves 4 omega 0.6 lambda 2.3
 }
 }
     }
#declare FnCubic   = function { pattern {
         // Povr's cubic_wave changed from POV-Ray's
         granite cubic_wave phase 0.3 frequency 1.77 scale 0.7 }
     }
#declare FnSine    = function { pattern {
         granite sine_wave scale 0.7 }
     }
#declare FnScallop = function { pattern {
         granite scallop_wave scale 0.7 }
     }
#declare FnTri     = function { pattern {
         granite triangle_wave scale 0.7 }
     }
#declare FnTriInv  = function { pattern {
         // Povr added an inverse wave modifier
         granite triangle_wave scale 0.7 }
     }
#declare FnPoly2_0 = function { pattern {
         granite poly_wave 2.0 scale 0.7 }
     }
#declare FnPoly0_2 = function { pattern {
         granite poly_wave 0.2 scale 0.7 }
     }
//---------
#declare Orange = srgb <1,0.50196,0>;
#declare HF_Base = height_field {
     function 800, 800 { FnBase(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.1,1>
     pigment { gradient y
               color_map  {jet}
               scale 0.15 }
}
#declare Acorn = srgb <0.41569,0.36471,0.10588>;
#declare HF_Cubic = height_field {
     function 800, 800 { FnCubic(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.1,1>
     pigment { gradient y
               color_map  {spring}
               scale 0.15 }
}
#declare Akaroa = srgb <0.83137,0.76863,0.65882>;
#declare HF_Sine = height_field {
     function 800, 800 { FnSine(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.1,1>
     pigment { gradient y
               color_map  {hot}
               scale 0.15 }
}
#declare Alpine = srgb <0.68627,0.56078,0.17255>;
#declare HF_Scallop = height_field {
     function 800, 800 { FnScallop(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.15,1>
     pigment { gradient y
               color_map  {winter}
               scale 0.04 }
}
#declare Amazonite = srgb <0,0.76863,0.6902>;
#declare HF_Tri = height_field {
     function 800, 800 { FnTri(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.1,1>
     pigment { gradient y
               color_map  {hsv}
               scale 0.15 }
}
#declare AndroidGreen = srgb <0.64314,0.77647,0.22353>;
#declare HF_TriInv = height_field {
     function 800, 800 { FnTriInv(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.15,1>
     pigment { gradient y
               color_map  {autumn}
               scale 0.05 }
}
#declare Apricot0 = srgb <0.92157,0.57647,0.45098>;
#declare HF_Poly2_0 = height_field {
     function 800, 800 { FnPoly2_0(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.1,1>
     pigment { gradient y
               color_map  {parula}
               scale 0.15 }
}
#declare AppleBlossom = srgb <0.68627,0.30196,0.26275>;
#declare HF_Poly0_2 = height_field {
     function 800, 800 { FnPoly0_2(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.4,1>
     pigment { gradient y
               color_map  {summer}
               scale 0.1 }
}
//---------
#declare Union00 = union {

     object { HF_Base }
     object { HF_Cubic   translate <-1.0,0,0>}
     object { HF_Sine    translate <-0.5,0,1> }
     object { HF_Scallop translate <-2.0,0,-0.5> }
     object { HF_Tri     translate <-1.0,0,-1> }
     object { HF_TriInv  translate <0,0,-1> }
     object { HF_Poly2_0 translate <-0.5,0,-2>}
     object { HF_Poly0_2 translate <1,0,-0.5> }

}
object {Union00}
------------------------------------------------------
YB


Post a reply to this message


Attachments:
Download 'wave_mods.png' (944 KB)

Preview of image 'wave_mods.png'
wave_mods.png


 

From: yesbird
Subject: Re: Height_fields and using wave modifiers.
Date: 14 Feb 2023 14:00:00
Message: <web.63ebd956a634f98a68fd655b10800fb2@news.povray.org>
> Attached is an image of 8 height_fields based upon a based on the
> granite pattern. Seven use only wave modifiers to change up the terrain.
> One uses a warp of directional turbulence.

This is a royal gift ! Can't stop playing with them:

------------------------------------------------------
#include "colormaps.inc" // From here: https://github.com/syanenko/colormaps

#version 3.8;
global_settings { assumed_gamma 1 }


camera
{ location <1,1,1> * 2
  look_at <0,0,0>
  angle 50
}


light_source { <10,10,10>, rgb <1,1,1> }


// The core code for reference.
#declare FnBase    = function { pattern {
         granite scale 0.7
         warp {
 turbulence <0.25,0.05,0> octaves 4 omega 0.6 lambda 2.3
 }
 }
     }
#declare FnCubic   = function { pattern {
         // Povr's cubic_wave changed from POV-Ray's
         granite cubic_wave phase 0.3 frequency 1.77 scale 0.7 }
     }
#declare FnSine    = function { pattern {
         granite sine_wave scale 0.7 }
     }
#declare FnScallop = function { pattern {
         granite scallop_wave scale 0.7 }
     }
#declare FnTri     = function { pattern {
         granite triangle_wave scale 0.7 }
     }
#declare FnTriInv  = function { pattern {
         // Povr added an inverse wave modifier
         granite triangle_wave scale 0.7 }
     }
#declare FnPoly2_0 = function { pattern {
         granite poly_wave 2.0 scale 0.7 }
     }
#declare FnPoly0_2 = function { pattern {
         granite poly_wave 0.2 scale 0.7 }
     }
//---------
#declare Orange = srgb <1,0.50196,0>;
#declare HF_Base = height_field {
     function 800, 800 { FnBase(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.1,1>
     pigment { gradient y
               color_map  {jet}
               scale 0.15 }
}
#declare Acorn = srgb <0.41569,0.36471,0.10588>;
#declare HF_Cubic = height_field {
     function 800, 800 { FnCubic(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.1,1>
     pigment { gradient y
               color_map  {spring}
               scale 0.15 }
}
#declare Akaroa = srgb <0.83137,0.76863,0.65882>;
#declare HF_Sine = height_field {
     function 800, 800 { FnSine(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.1,1>
     pigment { gradient y
               color_map  {hot}
               scale 0.15 }
}
#declare Alpine = srgb <0.68627,0.56078,0.17255>;
#declare HF_Scallop = height_field {
     function 800, 800 { FnScallop(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.15,1>
     pigment { gradient y
               color_map  {winter}
               scale 0.04 }
}
#declare Amazonite = srgb <0,0.76863,0.6902>;
#declare HF_Tri = height_field {
     function 800, 800 { FnTri(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.1,1>
     pigment { gradient y
               color_map  {hsv}
               scale 0.15 }
}
#declare AndroidGreen = srgb <0.64314,0.77647,0.22353>;
#declare HF_TriInv = height_field {
     function 800, 800 { FnTriInv(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.15,1>
     pigment { gradient y
               color_map  {autumn}
               scale 0.05 }
}
#declare Apricot0 = srgb <0.92157,0.57647,0.45098>;
#declare HF_Poly2_0 = height_field {
     function 800, 800 { FnPoly2_0(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.1,1>
     pigment { gradient y
               color_map  {parula}
               scale 0.15 }
}
#declare AppleBlossom = srgb <0.68627,0.30196,0.26275>;
#declare HF_Poly0_2 = height_field {
     function 800, 800 { FnPoly0_2(x,y,z) }
     smooth  // With smooth runs faster.
     scale <1,0.4,1>
     pigment { gradient y
               color_map  {summer}
               scale 0.1 }
}
//---------
#declare Union00 = union {

     object { HF_Base }
     object { HF_Cubic   translate <-1.0,0,0>}
     object { HF_Sine    translate <-0.5,0,1> }
     object { HF_Scallop translate <-2.0,0,-0.5> }
     object { HF_Tri     translate <-1.0,0,-1> }
     object { HF_TriInv  translate <0,0,-1> }
     object { HF_Poly2_0 translate <-0.5,0,-2>}
     object { HF_Poly0_2 translate <1,0,-0.5> }

}
object {Union00}
------------------------------------------------------
YB


Post a reply to this message


Attachments:
Download 'wave_mods.png' (944 KB)

Preview of image 'wave_mods.png'
wave_mods.png


 

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