POV-Ray : Newsgroups : povray.unofficial.patches : Isoblob patch beta Server Time
3 Sep 2024 02:15:54 EDT (-0400)
  Isoblob patch beta (Message 21 to 25 of 25)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Ron Parker
Subject: Re: Isoblob patch beta
Date: 5 Aug 1999 12:50:25
Message: <37a9c0d1@news.povray.org>
On Thu, 05 Aug 1999 12:21:37 -0400, Lummox JR wrote:
>BTW, I'd like to see the new isosurface files if possible; an addition
>of r, theta, and phi will likely force some modifications to my
>function-normal code.

You can get them from R. Suzuki's website if you really want them.
I'm not sure what effects it will have on you, though.  The changes
seem to be limited to isofunc.c and are in the form of new internal
functions:

static DBL R(FUNCTION *Func,VECTOR XYZ)
{
   return( sqrt(x*x + y*y + z*z ) );  
}

static DBL TH(FUNCTION *Func,VECTOR XYZ)
{
   return( atan2(x,z) );  
}

static DBL PH(FUNCTION *Func,VECTOR XYZ)
{
   return( atan2(sqrt(x*x + z*z ),y) );  
}

These functions are then added to the function table and used thusly:
(this example was taken from R. Suzuki's site and modified to actually 
render.  He seems to have made the (x,y,z) optional in his version, but 
I can't see where he did it, and my code is too much unlike his to do 
much in the way of diffs anymore.)

#declare TH=function{"TH"}
#declare R=function{"R"}
#declare PH=function{"PH"}

isosurface {
    function{cos(TH(x,y,z)*7)*0.2+min(abs(R(x,y,z)-1.5),abs(R(x,y,z)-3))+y*y}
    bounded_by{ box {<-3.7, -0.5, -3.7>, <3.7, 0.5, 3.7>}}
    threshold    0.5 
    accuracy 0.02
    max_gradient 1.7
    pigment {colour <0.8,0.5,0.2>}
    finish {ambient 0.2 phong 0.2}
    scale <1.25,1,1.25>
}


Post a reply to this message

From: Ron Parker
Subject: Re: Isoblob patch beta
Date: 5 Aug 1999 12:58:34
Message: <37a9c2ba@news.povray.org>
On Thu, 05 Aug 1999 12:21:37 -0400, Lummox JR wrote:
>(I don't understand the method 2 code yet. It'll take a while to 
>figure that one out.) 

This might help:

http://www.etl.go.jp/etl/linac/public/rsuzuki/e/povray/method1.htm

There are some weird characters on this page when you look at it in 
Netscape.  They appear to be Japanese spaces or something.


Post a reply to this message

From: Lummox JR
Subject: Re: Isoblob patch beta
Date: 6 Aug 1999 00:56:43
Message: <37AA6B40.2956@aol.com>
Ron Parker wrote:
> 
> On Thu, 05 Aug 1999 12:21:37 -0400, Lummox JR wrote:
> >BTW, I'd like to see the new isosurface files if possible; an addition
> >of r, theta, and phi will likely force some modifications to my
> >function-normal code.
> 
> You can get them from R. Suzuki's website if you really want them.
> I'm not sure what effects it will have on you, though.  The changes
> seem to be limited to isofunc.c and are in the form of new internal
> functions:
> 
> static DBL R(FUNCTION *Func,VECTOR XYZ)
> {
>    return( sqrt(x*x + y*y + z*z ) );
> }
> 
> static DBL TH(FUNCTION *Func,VECTOR XYZ)
> {
>    return( atan2(x,z) );
> }
> 
> static DBL PH(FUNCTION *Func,VECTOR XYZ)
> {
>    return( atan2(sqrt(x*x + z*z ),y) );
> }

Oh, I get it. So they're not in the main table like cos(), log(), etc.;
they're externals like "Sphere". In that case I don't have to do a
thing, no; my code already compensates for that. I was worried that
they'd be new variables, such that "R" would automatically push
sqrt(x^2+y^2) to the stack, etc. That would have messed with the normal
calculations a bit; I was concerned because I never got the
function-normal code to work for atan2(), and those would (I guessed
correctly) need that to work properly.

Lummox JR


Post a reply to this message

From: Nieminen Mika
Subject: Re: Isoblob patch beta
Date: 6 Aug 1999 03:23:22
Message: <37aa8d6a@news.povray.org>
Ron Parker <par### [at] fwicom> wrote:
: Also, can someone send me some photon test code that uses the new 
: syntax?  The only stuff I could find on this server is for the old
: patch with the 'density' modifier.

-----------------------------------------------------------------------
#declare phd=2;
#include "photons.inc"

camera { location <2,2,-8> look_at 0 angle 35 }
light_source { <100,20,0>,1 }
plane { y,-1 pigment { checker rgb 1, rgb .5 rotate y*45 } }
plane { x,-2 pigment { checker rgb 1, rgb .5 rotate x*45 } }

cylinder
{ -y,y,.8 Photons(yes,yes,no)
  pigment { rgbf <.5,1,.5,.95> }
  finish { specular .5 roughness .02 reflection .2 }
  interior { ior 1.5 }
}
-----------------------------------------------------------------------

photons.inc:
-----------------------------------------------------------------------
#ifndef(UsePhotons) #declare UsePhotons=yes; #end
#ifndef(phd) #declare phd=1; #end

global_settings
{ 
  #if(UsePhotons)
    photons
    { gather 20,100
      radius 0.1*phd, 2, 0.1*phd
      autostop 0
      jitter .4
      expand_thresholds 0.2, 40
      #ifdef(PhotonsMaxTraceLevel) max_trace_level PhotonsMaxTraceLevel #end
      #ifdef(PhotonsADCBailout) adc_bailout PhotonsADCBailout #end
    }
  #end  
}

#macro Photons(Refl,Refr,Ignore)
  #if(UsePhotons)
    photons
    { separation .01*phd
      reflection Refl
      refraction Refr
      #if(Ignore) ignore_photons #end
    }
  #end
#end
-----------------------------------------------------------------------


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


Post a reply to this message

From: Ron Parker
Subject: Re: Isoblob patch beta
Date: 6 Aug 1999 09:33:48
Message: <37aae43c@news.povray.org>
On 6 Aug 1999 03:23:22 -0400, Nieminen Mika wrote:
>Ron Parker <par### [at] fwicom> wrote:
>: Also, can someone send me some photon test code that uses the new 
>: syntax?  The only stuff I could find on this server is for the old
>: patch with the 'density' modifier.
>
>-----------------------------------------------------------------------
>#declare phd=2;
>#include "photons.inc"
[...]

Thanks, this is great.  Looks like photons will work in the next 
superpatch, thanks to Nathan.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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