POV-Ray : Newsgroups : povray.unofficial.patches : Re: Superpatch question. Server Time
4 Nov 2024 19:18:37 EST (-0500)
  Re: Superpatch question. (Message 1 to 2 of 2)  
From: Ron Parker
Subject: Re: Superpatch question.
Date: 29 Jul 1999 13:12:36
Message: <37a08b84@news.povray.org>
[crossposted from povray.general]

On Thu, 29 Jul 1999 12:41:36 +0100, Andrew Cocker wrote:
>Apologies if this is not the best places to ask this question ( I'm only
>subscribed to .general and .binaries.images at the moment ).

povray.unofficial.patches is generally considered the best place for 
these questions.  I've set followups to there.

[...]

>Firstly, I modified Gilles Tran's Egg scene as follows. I wanted to use
>splines to change a couple of the values, but I always get an error. After
>this, I have to restart POV as it will not render any other isosurface.

Well, that clearly shouldn't happen.  I'll have to look at that one.

>I initially tried using Colefax's AutoClck.mcr to change the same values,
>but that didn't work either. Is there a problem with using declared
>variables within an isosurface function? I *really* want to be able to
>animate isosurfaces.

Keep in mind that splines are not declared variables.  They're closer
to macros than to variables.  To use one, you'll probably have to 
declare a variable first.  Try this:

----------- cut here -------->8==========
#declare pos1=spline {
                 linear_spline
                 0, 0.04
                 1, 0.4
          }

#declare pos2=spline {
                 linear_spline
                 0, 0.04
                 0.5, 0.4
                 1, 0.04
          }             
          
#declare vpos1 = 0+pos1(clock);
#declare vpos2 = 0+pos2(clock);

#declare Egg=isosurface {
     function{ sqrt(x*x +y*y*0.5 +z*z) -5 + noise3d(x*1,y*1,z*1)*vpos1 +
noise3d(x*6,y*6,z*6)* vpos2 -0.125}
     bounded_by{ box {-8,8}}
     eval
     threshold  0
     method 2
     scale 1
}
----------- cut here -------->8==========

>Also, where can I get more information on how they work, or more
>specifically to explain the mathematic gibberish that resides inside the
>function statement :-) ?

An isosurface is the surface formed when you put an infinitesimal dust
mote at each and every point where a function is equal to a specific
value.  In the case of the egg, the function is that of an ellipsoid,
modified by a couple of noise functions at different scales.  Any decent
3d geometry book or website should be able to help you with the equations.

>Secondly, I can't work out how to access the inbuilt isosurface functions
> that the doc says are in there ), like sphere, superellipsoid etc. Can
>anyone help?

The syntax is tricky and I messed up the documentation as well.  The
proper syntax is like this:

     function{ "sphere" <5> }

Both the quotes and the angle brackets are necessary.


Post a reply to this message

From: Andrew Cocker
Subject: Re: Superpatch question.
Date: 29 Jul 1999 16:28:18
Message: <37a0b962@news.povray.org>
Ron,

Thanks for your reply . I am now able to animate isosurfaces.

Andy

Ron Parker <par### [at] fwicom> wrote in message
news:37a08b84@news.povray.org...
> [crossposted from povray.general]
>
> On Thu, 29 Jul 1999 12:41:36 +0100, Andrew Cocker wrote:
> >Apologies if this is not the best places to ask this question ( I'm only
> >subscribed to .general and .binaries.images at the moment ).
>
> povray.unofficial.patches is generally considered the best place for
> these questions.  I've set followups to there.
>
> [...]
>
> >Firstly, I modified Gilles Tran's Egg scene as follows. I wanted to use
> >splines to change a couple of the values, but I always get an error.
After
> >this, I have to restart POV as it will not render any other isosurface.
>
> Well, that clearly shouldn't happen.  I'll have to look at that one.
>
> >I initially tried using Colefax's AutoClck.mcr to change the same values,
> >but that didn't work either. Is there a problem with using declared
> >variables within an isosurface function? I *really* want to be able to
> >animate isosurfaces.
>
> Keep in mind that splines are not declared variables.  They're closer
> to macros than to variables.  To use one, you'll probably have to
> declare a variable first.  Try this:
>
> ----------- cut here -------->8==========
> #declare pos1=spline {
>                  linear_spline
>                  0, 0.04
>                  1, 0.4
>           }
>
> #declare pos2=spline {
>                  linear_spline
>                  0, 0.04
>                  0.5, 0.4
>                  1, 0.04
>           }
>
> #declare vpos1 = 0+pos1(clock);
> #declare vpos2 = 0+pos2(clock);
>
> #declare Egg=isosurface {
>      function{ sqrt(x*x +y*y*0.5 +z*z) -5 + noise3d(x*1,y*1,z*1)*vpos1 +
> noise3d(x*6,y*6,z*6)* vpos2 -0.125}
>      bounded_by{ box {-8,8}}
>      eval
>      threshold  0
>      method 2
>      scale 1
> }
> ----------- cut here -------->8==========
>
> >Also, where can I get more information on how they work, or more
> >specifically to explain the mathematic gibberish that resides inside the
> >function statement :-) ?
>
> An isosurface is the surface formed when you put an infinitesimal dust
> mote at each and every point where a function is equal to a specific
> value.  In the case of the egg, the function is that of an ellipsoid,
> modified by a couple of noise functions at different scales.  Any decent
> 3d geometry book or website should be able to help you with the equations.
>
> >Secondly, I can't work out how to access the inbuilt isosurface functions
> > that the doc says are in there ), like sphere, superellipsoid etc. Can
> >anyone help?
>
> The syntax is tricky and I messed up the documentation as well.  The
> proper syntax is like this:
>
>      function{ "sphere" <5> }
>
> Both the quotes and the angle brackets are necessary.


Post a reply to this message

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