POV-Ray : Newsgroups : povray.text.tutorials : Landscape : Re: Landscape Server Time
10 Oct 2024 03:41:21 EDT (-0400)
  Re: Landscape  
From: David Wallace
Date: 16 Jul 2006 16:20:50
Message: <44BA9FB1.6000609@earthlink.net>
gonzo wrote:
> "Shams" <sha### [at] yahoocom> wrote:
>> Folks I've been trying to make a realistic landscape using POV-ray 3.5 but
>> I'm not getting satisfactory results. The tutorials were of little help.
>> Help Please!
>>
>> Shams
> 
> What are you trying, and which results aren't satisfactory?  (Isosurface?
> Height_field?  Wrong shape? Bad texture?)  Landscapes are a complex
> subject, and usually require a mix of several different factors to work.
> 
> RG
> 
> 
> 
Roll your own:

// Landscape functions

#include "functions.inc"

#declare IsTest = 0;
#declare IsWater = 0;

#global_settings {
	#if(!IsTest) hf_gray_16 on #end
	number_of_waves 35
}

#declare aspect = image_width/image_height;
#declare aperSize = 3000;

#declare l0Pat = function { f_ridged_mf(x,y,z,0.01,3.58,19,-.0,3.1,3) }

#declare l1Pat = function { pattern {
	crackle
	metric 1.4
	form <1.0,-0.2, 0.3>
	scale 1400
} }

#declare l2Pat = function { pattern {
	granite
	scale 4900
} }

#declare w1Pat = function { pattern {
	waves
	triangle_wave
	frequency 12
	turbulence 0.21
	scale 3000
} }

#declare w2Pat = function { pattern {
	ripples
	triangle_wave
	frequency 43
	turbulence 0.21
	scale 5000
} }

#declare l3Pat = function { pattern {
	leopard
	sine_wave
	turbulence 1.21
	octaves 8
	omega 0.73
	scale 800
} }

#if (IsWater)
	#declare lkpat = function { pow(w1Pat(x,y,z),0.5)*.70 + 
pow(w2Pat(x,0,z),2.0)*0.30 }
#else
	#declare lkpat = function { (1-pow(l1Pat(x,y,z),1.2))*.88 + 
pow(l2Pat(x,0,z),1.2)*0.15+pow(l3Pat(x,0,z),2)*0.20 }
#end

plane { y, 0
	texture {
		pigment {
			function { lkpat(x,y,z) }
			color_map {
				[0.00 rgb (IsTest ? <0,1,1> : <0,0,0>) ]
				[1.00 rgb (IsTest ? <1,0,0> : <1,1,1>) ]
			}
		}
		finish { ambient 1 }
	}
}

camera {
	orthographic
	location < 0.0, 2.0, 0.0> look_at < 0.0, 0.0, 0.0>
	right x*aperSize*aspect
	up z*aperSize
}

What I am creating here is an image that can then be used as a height field.

#declare Ground = height_field {
	png "lakeb.png"
	smooth
	translate <-.5,-.5,-.5>
	texture { texGnd }
	scale <1e4, 260, 1e4>
}


-- 
--------------
David Wallace
TenArbor Consulting
"Just In Time Cash"
www.tenarbor.com
1-866-572-CASH


Post a reply to this message

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