|
|
In article <3e4e5ad3@news.povray.org>,
"Tim McMurdo" <tmc### [at] prodigynet> wrote:
> Is it possible to average 2 heightfields within POV? I am thinking of doing
> this to generate an ocean surface.
Many ways. First, declare 2 pigment functions with the height maps as
image_maps:
#declare HghtFn1 = function {pigment {image_map {...}}}
#declare HghtFn2 = function {pigment {image_map {...}}}
Now there are several ways you can use these. The most obvious would be
an isosurface:
isosurface {
function {y - (HghtFn1(x, y, z) + HghtFn2(x, y, z))/2}
threshold 0
}
You could also use them to create a height field with the built-in
height_field primitive:
height_field {
function XRes, YRes {(HghtFn1(x, y, z) + HghtFn2(x, y, z))/2}
}
Or you could use the height field macros from shapes.inc.
HF_Square(function {(HghtFn1(x, y, z) + HghtFn2(x, y, z))/2},
no, no, < XRes, YRes>, yes, "hf.pov", <-1,-1,-1>, < 1, 1, 1>)
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/
Post a reply to this message
|
|
|
|
"Christopher James Huff" <cja### [at] earthlinknet> wrote in message
> You could also use them to create a height field with the built-in
> height_field primitive:
>
> height_field {
> function XRes, YRes {(HghtFn1(x, y, z) + HghtFn2(x, y, z))/2}
> }
>
You beat me to it!
See my image just posted in p.b.i. for an example of the effect
John
--
War is not good for children and other living things
Post a reply to this message
|
|