POV-Ray : Newsgroups : povray.beta-test : more function issues Server Time
31 Jul 2024 08:22:32 EDT (-0400)
  more function issues (Message 1 to 7 of 7)  
From: Dennis Milller
Subject: more function issues
Date: 6 Sep 2001 21:56:48
Message: <3b982960@news.povray.org>
Can someone show me the exact syntax needed for declaring a function? Here's
the old version:
#declare FUNC1=function {"sphere",<4>}

Thanks much.,
D.
--
dhm### [at] mediaonenet
www.casdn.neu.edu/~dmiller


Post a reply to this message

From: Bob H 
Subject: Re: more function issues
Date: 6 Sep 2001 23:29:24
Message: <3b983f14$1@news.povray.org>
"Dennis Milller" <dhm### [at] mediaonenet> wrote in message
news:3b982960@news.povray.org...
> Can someone show me the exact syntax needed for declaring a function?
Here's
> the old version:
> #declare FUNC1=function {"sphere",<4>}

Hopefully I can.

 #declare FUNC1=function {f_sphere (x,y,z,1)}

I remembered that from the files i_internal.pov and functions.inc, so have a
look at those.  The internalized numbering is shown in functions.inc.

Bob H.


Post a reply to this message

From: Warp
Subject: Re: more function issues
Date: 7 Sep 2001 05:59:09
Message: <3b989a6d@news.povray.org>
Bob H. <omn### [at] msncom> wrote:
:  #declare FUNC1=function {f_sphere (x,y,z,1)}

  Remember to #include "functions.inc" before that.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Dennis Milller
Subject: Re: more function issues
Date: 7 Sep 2001 07:17:48
Message: <3b98acdc$1@news.povray.org>
Thanks. Does the addition of "x,y,z" in the new syntax change any aspect of
the function and is it even required? I'm trying to duplicate an exact MP
scene that used the line below (with no x,y,z). I assume that "x,y,z" was
"understood" in the older syntax...
Thanks again,
D.

"Bob H." <omn### [at] msncom> wrote in message
news:3b983f14$1@news.povray.org...
> "Dennis Milller" <dhm### [at] mediaonenet> wrote in message
> news:3b982960@news.povray.org...
> > Can someone show me the exact syntax needed for declaring a function?
> Here's
> > the old version:
> > #declare FUNC1=function {"sphere",<4>}
>
> Hopefully I can.
>
>  #declare FUNC1=function {f_sphere (x,y,z,1)}
>
> I remembered that from the files i_internal.pov and functions.inc, so have
a
> look at those.  The internalized numbering is shown in functions.inc.
>
> Bob H.
>
>


Post a reply to this message

From: Warp
Subject: Re: more function issues
Date: 7 Sep 2001 10:31:20
Message: <3b98da38@news.povray.org>
Dennis Milller <dhm### [at] mediaonenet> wrote:
: Thanks. Does the addition of "x,y,z" in the new syntax change any aspect of
: the function and is it even required?

  I think you misunderstand. It's not like they thought "hey, we need to
convert the sphere function to pov3.5; how about adding 'x,y,z' just in case
and because it looks cool?".
  All the functions have the same form, that is, the 'x,y,z' space coordinates
where to calculate the function plus possibly some extra parameters which
define the shape (eg. the radius). The function could not calculate the correct
value if it doesn't have the x, y and z values (how else can it know where
to calculate?).
  And besides, this allows to make modifications to the sphere easily. Just
imagine what do these do: f_sphere(x^2,y,z,1), f_sphere(x,0,z,1), etc.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: more function issues
Date: 7 Sep 2001 11:15:13
Message: <3b98e481$1@news.povray.org>
In article <3b982960@news.povray.org> , "Dennis Milller" 
<dhm### [at] mediaonenet> wrote:

> Can someone show me the exact syntax needed for declaring a function? Here's
> the old version:
> #declare FUNC1=function {"sphere",<4>}

Please check the documentation (under functions, not under isosurfaces), it
has lot more details than the megaPOV docs had, and it explains all syntax
variants.


    Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Mike Williams
Subject: Re: more function issues
Date: 8 Sep 2001 02:35:18
Message: <iJWTfEAEvbm7EwwK@econym.demon.co.uk>
Wasn't it Dennis Milller who wrote:

>Thanks. Does the addition of "x,y,z" in the new syntax change any aspect of
>the function and is it even required? I'm trying to duplicate an exact MP
>scene that used the line below (with no x,y,z). I assume that "x,y,z" was
>"understood" in the older syntax...

With the MegaPOV syntax you had to #declare your imported functions if
you wanted to use them in expressions, and then you would apply the
"x,y,z" when you used it, like

        #declare FUNC1=function {"sphere",<4>}
        isosurface {function {FUNC1(x,y,z) + noise3d(...

[If you were using the function without any modification at all you
could say
        isosurface {function { "Sphere" <0.4>}
in which case the x,y,z was "understood"]


With the new syntax you are never forced to #declare the function. You
can use it directly in expressions if you would prefer, like

        #include "functions.inc"
        isosurface {function {f_sphere(x,y,z,4) + f_noise3d(...



-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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