POV-Ray : Newsgroups : povray.general : Isosurface hills : Re: Isosurface hills Server Time
10 Aug 2024 03:19:43 EDT (-0400)
  Re: Isosurface hills  
From: Lummox JR
Date: 18 Mar 2000 16:38:04
Message: <38D3F88C.7F17@aol.com>
Chris Huff wrote:
> > Modifications I've made so far to the function code:
> >
> > - Added functions floor(), ceil(), if() (like the C ?: operator),
> >   pi, clock, atan2(), radians(), degrees()
> 
> These sound interesting...I notice that they have already been included
> in MegaPOV.

Hmmm... I wonder if they're mine.
All those function changes I sent out to Ron Parker for the Superpatch.
The isoblob patch I don't think is in there, though.

> > - int_func3d() was completely rewritten and evaluate_interval()
> >   changed to allow interval (method 1) testing which wasn't possible
> >   before
> 
> Could you clarify this? I don't really understand what you mean.

Interval testing works for most functions, but it doesn't work for a
function within a function. Example:

#declare F1=function {cub(x)+sqr(y)}
#declare F2=function {F1(x,y)-F1(y,z)}

An isosurface using function F2 can't use method 1 because the intervals
for F1 aren't tested properly. I rewrote int_func3d, which was basically
just an empty do-nothing function, to act the way it was supposed to in
the first place.

> > - norm_<function> functions added to evaluate an exact normal where
> >   possible (using a new "normal" keyword as part of an isosurface,
> >   parametric, or my own isoblob)
> 
> Is this related to the second normal calculation method, also included
> in MegaPOV?

That I wouldn't know; I haven't seen MegaPOV or its source. For all I
know it might be based on my patch--if you have the source, my name
should be plastered all over f_func.c and several related files if it's
based on my code.

> > I think I'll just go ahead and add an unclipped noise function to the
> > code; I may as well at this point. I just need something to call it
> > other than noise3d(), and I'll need to rewrite the interval function to
> > compensate for the fact that this can reach values beyond the 0-1 limit.
> 
> Could you add 4D noise while you are at it? :-)
> I think this might be useful for some things, maybe for fire.

Funny, but I was thinking along the exact same lines earlier when I was
modifying the code. It occurred to me that it would be nice to have an
N-dimensional noise function. Many a time I've wanted to have 4D noise
for clouds and such. If I understand the Noise() code well enough,
basically all you'd have to do would be to recurse the sucker. This
could extend noise to as many dimensions as you'd want, if it was done
right. (Of course, some preprocessing would help to prevent a lot of
useless recalculations, since speed is always a factor.)
I really don't know how this could be included in the function code
without greatly modifying it, since the code wasn't intended to go past
3 arguments per function. (The so-called 4-argument functions are
actually just a declared function number plus 3 more arguments.) I've
always wanted to see if that could be arbitrarily extended; the
challenge is definitely intriguing enough for me to take it up sometime.

BTW, I've gone ahead and added the Noise_raw function to texture.c. I
gave it a function name "bozo", to avoid having to add one more keyword
to the parser.
I added two new functions while I was in there:

range(v,min,max)  -- basically a shortcut for min(max(v,min),max)
bozo(x,y,z) -- raw noise

Lummox JR


Post a reply to this message

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