POV-Ray : Newsgroups : povray.general : Superpatch question. Server Time
1 Nov 2024 19:14:59 EDT (-0400)
  Superpatch question. (Message 1 to 2 of 2)  
From: Andrew Cocker
Subject: Superpatch question.
Date: 29 Jul 1999 12:23:44
Message: <37a08010@news.povray.org>
Hi all,

Apologies if this is not the best places to ask this question ( I'm only
subscribed to .general and .binaries.images at the moment ).

I've just downloaded the latest superpatch ( thanks Ron ), and have a couple
of questions, mostly relating to the isosurface function.

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.
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.

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 :-) ?

#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 Egg=isosurface {
     function{ sqrt(x*x +y*y*0.5 +z*z) -5 + noise3d(x*1,y*1,z*1)*pos1 +
noise3d(x*6,y*6,z*6)* pos2 -0.125}
     bounded_by{ box {-7,7}}
     eval
     threshold  0
     method 2
     scale 1
}

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?

Thanks in advance for your suggestions.

Andy Cocker


Post a reply to this message

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

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