POV-Ray : Newsgroups : povray.advanced-users : height field generation : Re: height field generation Server Time
3 Jul 2024 05:24:19 EDT (-0400)
  Re: height field generation  
From: Dan Connelly
Date: 30 Sep 2008 11:24:09
Message: <48e24499$1@news.povray.org>
Christian Froeschlin wrote:
>> I found the Perl::GD module convenient for generating a height field.  
> 
> If you have a function to generate the height
> field, you can also use it in SDL directly:
> 
> #declare npoints = 512;
> #declare f       = function {0.1+0.1*sin(x*20)};
> #declare fmax    = 0.2;
> 
> height_field
> {
>   function npoints, npoints {f(x,0,y)/fmax}
> }

Thanks!

A disadvantage of the Perl GD module is I can't figure out how to generate 16-bit PNG
with it, which is a real issue, even with "smooth".  The advantage, of course, is you
needn't reevaluate the function each time the code is executed, depending on the
function complexity.

Dan


Post a reply to this message

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