POV-Ray : Newsgroups : povray.general : Trying to translate an isosurface function Server Time
1 Nov 2024 17:19:57 EDT (-0400)
  Trying to translate an isosurface function (Message 1 to 5 of 5)  
From: Alan M
Subject: Trying to translate an isosurface function
Date: 10 Nov 2011 20:35:01
Message: <web.4ebc7b038b30719f193ade1e0@news.povray.org>
Hi,



trying to do is translate the result of a function on the isosurface in the x or


I can create a rippled surface for my isosurface using the following:

function {(y - cos(sqrt(x*x + z*z)*5*pi)*0.08}

I can get the same result if I construct the function using a pattern, using
something like:

#declare fn_ripples1 = function {
  pattern {ripples scale 0.1 translate <0.5, 0, 0.5>}
}

The advantage of the pattern is I can translate the result of the function




different surface to that generated by the function outside of the pattern.

#declare fn_myripples = function { // This doesn't work as expected
  pattern {
    function {cos(sqrt(x*x + z*z)*5*pi)*0.08}
  }
}



obvious.

Any suggestion are welcome.

Cheers,
Alan


Post a reply to this message

From: Thomas de Groot
Subject: Re: Trying to translate an isosurface function
Date: 11 Nov 2011 02:57:10
Message: <4ebcd556$1@news.povray.org>
On 11-11-2011 2:31, Alan M wrote:



> obvious.
>
> Any suggestion are welcome.
>

I think paragraph *2.3.3.3.9 Transformations on functions* of the docs 
will help you.

Thomas


Post a reply to this message

From: Alan M
Subject: Re: Trying to translate an isosurface function
Date: 11 Nov 2011 05:30:01
Message: <web.4ebcf87d259ed049193ade1e0@news.povray.org>
Thomas de Groot <tenDOTlnDOTretniATtoorgedDOTt> wrote:
> On 11-11-2011 2:31, Alan M wrote:
>


> > obvious.
> >
> > Any suggestion are welcome.
> >
>
> I think paragraph *2.3.3.3.9 Transformations on functions* of the docs
> will help you.
>
> Thomas

Thanks, it does help and explains the approach very well. Bit embarrassed to get
an RTFM as I was reading this part of the docs before I posted the question -
should've kept reading.

Alan


Post a reply to this message

From: Thomas de Groot
Subject: Re: Trying to translate an isosurface function
Date: 11 Nov 2011 07:26:48
Message: <4ebd1488$1@news.povray.org>
On 11-11-2011 11:27, Alan M wrote:
> Thanks, it does help and explains the approach very well. Bit embarrassed to get
> an RTFM as I was reading this part of the docs before I posted the question -
> should've kept reading.
>

Sooner or later we all sin against the RTFM law ;-)

Thomas


Post a reply to this message

From: Slime
Subject: Re: Trying to translate an isosurface function
Date: 13 Nov 2011 04:38:02
Message: <4ebf8ffa@news.povray.org>

 > different surface to that generated by the function outside of the 
pattern.
 >
 > #declare fn_myripples = function { // This doesn't work as expected
 >    pattern {
 >      function {cos(sqrt(x*x + z*z)*5*pi)*0.08}
 >    }
 > }

I believe patterns evaluate the function and then wrap the resulting 
value to the range [0,1). Since cos() returns negative numbers 
sometimes, they're getting wrapped around to higher values (for 
instance, -.3 becomes .7).

  - Slime


Post a reply to this message

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