prev index next 
Modelling Tips, Working With Primitives 
 POV-Ray Tips, 
 Tricks, and Techniques
Height_Fields + Geographic Content? 
 
Roy Willy Haug is looking for realism: I know POV-Ray can create 3D terrain from heightfields. Is it possible to display textures or colors for lakes, woods, rivers and other geographic information with _correct placement_ in the 3D terrain? 
 
David J. Carlyon has a suggestion:
If I understand your question correctly, then yes, it's possible in POV-Ray. Something I've been playing with lately is making images in Photoshop (the clouds and difference clouds filters work well for this) for heightfields. I make two versions of the same image, one greyscale, just to make it easier to see what I'm going to end up with for the heights, and one version in color. I use the greyscale for the heightfield, and the color version for an image map for that heightfield. If you do it right (and it's tricky, but then again, so's everything else at first), and have the size and alignment correct, it should work. 
 
and Kerwin D Kanago adds:  You might also try this using a height field and an image map created by rendering two POV-Ray files derived from the same basic file/pattern. 

Take the two files below, render each of them and use the imagemap file as pigment for a height field. 

--> Not very artistic but you-can-get-the-idea code follows. <-- 
****** hf.pov 
 //Height Field 
  camera { location <0, 0, -2> } 
  plane { z, 0 
     finish { ambient 1 } 
     pigment { bozo pigment_map{
        [0.2 rgb 0] //water level 
        [1   rgb 1]} //Hills 
  }} 

******* im.pov 
  //Image Map 
  camera { location <0, 0, -2> } 
  plane { z, 0 
     finish { ambient 1 } 
     pigment { bozo pigment_map{ 
        [0.2 rgb <0,0,1>] //water level 
        [0.2   bozo scale 0.2 
               color_map{ [0 rgb<0,1,0>] 
                 [1 rgb<0.5,0.5,0.25>] 
               } 
        ]} //Hills 
  }} 

******* stick this in your "real" pov file 
height_field 
{ 
  tga "hf.tga" 
  texture 
  { 
    pigment 
    { 
      image_map { tga "im.tga" map_type 0 interpolate 2 once } 
      rotate x*90 
    } 
  } 

scale <5,2,5> 
} 
 

  1