POV-Ray : Newsgroups : povray.general : Height field averaging? Server Time
17 Nov 2024 15:12:37 EST (-0500)
  Height field averaging? (Message 1 to 4 of 4)  
From: Tim McMurdo
Subject: Height field averaging?
Date: 15 Feb 2003 10:20:51
Message: <3e4e5ad3@news.povray.org>
Is it possible to average 2 heightfields within POV? I am thinking of doing
this to generate an ocean surface.

Thanks,

Tim


Post a reply to this message

From: Christopher James Huff
Subject: Re: Height field averaging?
Date: 15 Feb 2003 11:40:32
Message: <cjameshuff-C02A93.11392815022003@netplex.aussie.org>
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

From: Doctor John
Subject: Re: Height field averaging?
Date: 15 Feb 2003 11:42:50
Message: <3e4e6e0a@news.povray.org>
"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

From: Tim McMurdo
Subject: Re: Height field averaging?
Date: 15 Feb 2003 12:45:04
Message: <web.3e4e7bcac39150269a303f820@news.povray.org>
Thank you both, I'll give it a try & post an image with the results.

Thanks,

Tim


Post a reply to this message

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