POV-Ray : Newsgroups : povray.binaries.images : Gancaloon - urbanism wip : Re: Gancaloon - urbanism wip Server Time
30 Jul 2024 14:24:11 EDT (-0400)
  Re: Gancaloon - urbanism wip  
From: Thomas de Groot
Date: 3 Aug 2011 08:03:40
Message: <4e39391c$1@news.povray.org>
On 2-8-2011 0:29, Christian Froeschlin wrote:
> Instead of averaging with the cell pattern you could multiply the
> cell function value with coarsely sampled evaluations of the original
> height_field image. That would give "city blocks" of constant height
> appropriate for local average terrain. It will introduce steps on
> roofs that fall on a cell boundary but maybe it looks like an
> intended structure ;)
>

Well, this is not as simple as it seems, or I am doing something wrong 
(probably).

I wrote a simple test code which I think explains things. Just insert it 
in a basic scene:

//Start code
#declare HF_pig =
pigment {
   image_map {
    png "plasma3.png"
   }
   rotate -90*x
}

#declare F_cells =
function {
   pigment {
     cells
     color_map {
       [0.1 rgb 0.4]
       [0.9 rgb 0.6]
     }
     //warp {turbulence <0.1, 0, 0.1>}
     scale 0.03
   }
}

#declare F_HF_00 =
function {
   pigment {
     image_map {
       png "plasma3.png" gamma 1.0
       map_type 0
       interpolate 2
     }
   }
}

#declare F_flatroof =
function {
     F_cells(x,y,z).hf
   * F_HF_00 (x,y,z).hf
}

#declare hf_cut =
intersection {
height_field {
   function 500, 500 {F_flatroof(x,y,z)}
   smooth
   translate <-0.5, 0, -0.5>
   scale <10, 1, 10>
}
   box {
     <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5>
     scale <10, 1, 10> * <0.99, 20, 0.99>
   }
   translate 1.0*y
}

intersection {
   object {hf_cut}
   box {
     <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5>
     scale <3, 10, 5>
     rotate 45*y
   }
   pigment {rgbt <1,1,0,0.1>}
}

//----------------------------------------------------------
intersection {
height_field {
   function 1000, 1000 {F_HF_00(x,y,z).hf}
   smooth
   pigment {HF_pig}
   translate <-0.5, 0.0, -0.5>
   scale <10, 1, 10>
}
   box {
     <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5>
     scale <10, 1, 10> * <0.99, 10, 0.99>
   }
}
//End code

Thomas


Post a reply to this message

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