POV-Ray : Newsgroups : povray.unofficial.patches : ISO question, returning y val Server Time
2 Sep 2024 02:14:25 EDT (-0400)
  ISO question, returning y val (Message 1 to 7 of 7)  
From: Tom Melly
Subject: ISO question, returning y val
Date: 27 Jul 2000 10:11:38
Message: <3980431a$1@news.povray.org>
Is there anyway, when using iso-surfaces, of returning the max and min
values of the surface for y?

For example, if creating a turbulent sea (!) how would I easily find out
what the highest wave peak was and the lowest trough?


Post a reply to this message

From: Warp
Subject: Re: ISO question, returning y val
Date: 27 Jul 2000 12:01:58
Message: <39805cf5@news.povray.org>
Tom Melly <tom### [at] tomandluf9couk> wrote:
: Is there anyway, when using iso-surfaces, of returning the max and min
: values of the surface for y?

  For many function this can be analytically impossible to calculate. You
can try to approximate with some stochastic algorithm.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Tom Melly
Subject: Re: ISO question, returning y val
Date: 27 Jul 2000 12:21:19
Message: <3980617f@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:39805cf5@news.povray.org...
> Tom Melly <tom### [at] tomandluf9couk> wrote:
> : Is there anyway, when using iso-surfaces, of returning the max and min
> : values of the surface for y?
>
>   For many function this can be analytically impossible to calculate.

So what is POV doing? Does it calculate the surface in some way that doesn't
depend on "knowing" where the surface is?

> You
> can try to approximate with some stochastic algorithm.
>

Well, you could. Meanwhile, I'll go and look up "stochastic" in the
dictionary.


Post a reply to this message

From: Warp
Subject: Re: ISO question, returning y val
Date: 27 Jul 2000 12:26:59
Message: <398062d1@news.povray.org>
Tom Melly <tom### [at] tomandluf9couk> wrote:
:>   For many function this can be analytically impossible to calculate.

: So what is POV doing? Does it calculate the surface in some way that doesn't
: depend on "knowing" where the surface is?

  Povray uses a stochastic algorithm, ie. it takes many samples and tries
to approximate the right value. It will seldom hit the mathematically exact
value.
  (This as far as I have understood correctly the isosurface raytracing.)

:> You
:> can try to approximate with some stochastic algorithm.

: Well, you could. Meanwhile, I'll go and look up "stochastic" in the
: dictionary.

  Stochastic (AFAIK) is a method of taking many samples and searching the
correct value this way. Povray's radiosity uses this kind of technique.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: ISO question, returning y val
Date: 27 Jul 2000 12:45:01
Message: <slrn8o0qft.uip.ron.parker@fwi.com>
On 27 Jul 2000 12:26:59 -0400, Warp wrote:
>Tom Melly <tom### [at] tomandluf9couk> wrote:
>:>   For many function this can be analytically impossible to calculate.
>
>: So what is POV doing? Does it calculate the surface in some way that doesn't
>: depend on "knowing" where the surface is?
>
>  Povray uses a stochastic algorithm, ie. it takes many samples and tries
>to approximate the right value. It will seldom hit the mathematically exact
>value.
>  (This as far as I have understood correctly the isosurface raytracing.)

Well, it's not technically stochastic.  Stochastic implies some degree of
(pseudo)randomness.  POV (Well, MegaPOV, and future versions of POV) does 
use a numerical algorithm, and thus is susceptible to error, but it's 
deterministic and the error can be bounded to be as small as you want to,
within the limits of your machine's FP precision.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Greg M  Johnson
Subject: Re: ISO question, returning y val
Date: 31 Jul 2000 10:17:34
Message: <39858943.B02BF0E2@my-dejanews.com>
Tom Melly wrote:

> Is there anyway, when using iso-surfaces, of returning the max and min
> values of the surface for y?

In case you weren't able to decipher their answers, they mean the following.
(I have working code for this at home, this is from memory):

Assume your box is bounded by        _/- x_extent, and  _/- z_extent

#delcare ymin=1000000000;
#declare ymax=-1000000000;
#declare ysum=0;
#declare count=0;

#declare dx=0;
#declare dz=0;
#while(dx<100)  // or any other big number
    #while (dz<100)  // or any other big number
        #declare Norm=<0,0,0>;

        #declare tracey=trace(Your_Iso_Object,  < (dx-50)/50*x_extent,
10000000,  (dx-50)/50*x_extent>, -y, Norm);

        #if (Norm.x = 0 & Norm.y=0 & Norm.z = 0)
            #debug "You tried to sample a point that is beyond the extent of
the surface, I'm quittin' >:-P"
            #declare asdf=1/0;
        #else
            #if (tracey.y>ymax)
                 #declare ymax=tracey;
            #end
            #if (tracey.y<ymin)
                 #declare ymin=tracey.y;
           #end
            #declare ysum=ysum+tracey.y;
            #declare count=count+1;
         #end
#declare dz=dz+1;
#end
#declare dz=0;
#declare dx=dz+1;
#end
#declare yavg=ysum/count;


Post a reply to this message

From: Tom Melly
Subject: Re: ISO question, returning y val
Date: 31 Jul 2000 11:02:05
Message: <398594ed@news.povray.org>
"Greg M. Johnson" <gre### [at] my-dejanewscom> wrote in message
news:39858943.B02BF0E2@my-dejanews.com...
> Tom Melly wrote:
>
> > Is there anyway, when using iso-surfaces, of returning the max and min
> > values of the surface for y?
>
> In case you weren't able to decipher their answers, they mean the
following.
> (I have working code for this at home, this is from memory):
>
> <SNIP>

Ah, many thanks. I'll try it tonight. - so "stochastic" is just a posh word
for kludge? ;)


Post a reply to this message

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