From comp.graphics.raytracing Thu Aug 11 13:04:38 1994 Newsgroups: comp.graphics.raytracing Path: uniol!zib-berlin.de!uni-paderborn.de!urmel.informatik.rwth-aachen.de!newsserver.rrzn.uni-hannover.de!solaris.rz.tu-clausthal.de!verleihnix.rz.tu-clausthal.de!incp From: incp@verleihnix.rz.tu-clausthal.de (Christian Perle) Subject: Re: Mountains - HOW ? Message-ID: <1994Aug6.103330.21661@solaris.rz.tu-clausthal.de> Sender: root@solaris.rz.tu-clausthal.de (Operator) Organization: Techn. Univ. Clausthal X-Newsreader: TIN [version 1.2 RZ-TUC PL2] References: Date: Sat, 6 Aug 1994 10:33:30 GMT Lines: 91 Dan Farmer (Dan.Farmer@TGA.damar.com) wrote: : RH:Here's what I wish to do : create random mountains with a prog. : RH:The problem is I only have a vague idea. [...] : In other words: there are many simple mountain generators. Why do : another one. Improve on them if you can. Here's something I've done a few months ago. My method uses POV-Ray _only_ to generate mountains. First, render the scene hfpic.pov to a TGA file at a size of 100x100 pixels. Then render the scene landscap.pov using the TGA file hfpic.tga that's it! ================ // hfpic.pov -- create a 100x100 TGA file for mountain height_field #include "colors.inc" #include "textures.inc" camera { location <0, 0, -2> direction <0, 0, 1.5> up <0, 1, 0> right <1, 0, 0> look_at <0, 0, 0> } plane { z, 0 pigment { White_Marble translate <10, 10, 10> // translate to any point that makes a good h'field scale 3 } finish { ambient 1 } } ============== // landscap.pov -- landscape with height_field, requires hfpic.tga // )C( 1994 Christian Perle #include "colors.inc" camera { location <-1, 4, -3> direction <0, 0, 2.5> up <0, 1, 0> right <4/3, 0, 0> look_at <0.4, 1, 2> } light_source { <2, 4, -3> color White } // light from the side light_source { <-1, 500, 2> color Gray50 } // light from above #declare Level = 0.35 // 0 <= Level < 0.7 union { // mountain height_field { tga "hfpic.tga" water_level Level smooth pigment { gradient y color_map { [Level color Green] [0.7 color red .9 green .7 blue .5] [0.9 color red 1 green .8 blue .6] [1.0 color White] } quick_color Yellow } finish { phong .3 } } // water area box { <0, 0, 0>, <1, Level, 1> pigment { color Cyan } } scale <2, 1, 2> rotate <0, 45, 0> translate <-1, 0.5, 2> } -- +----------------------------------+--------------------------------------+ | Christian Perle | So, if you feel a little glum | | Schulstr. 13 | to Hergest Ridge you should come | | 38678 Clausthal-Zellerfeld +---------------------Mike-Oldfield----+ | Germany | ComputerGuitarKitesBicyclesBeerPizza | +----------------------------------+--------------------------------------+