POV-Ray : Newsgroups : povray.advanced-users : isosurface: Does the order of multiple functions matter? : Re: isosurface: Does the order of multiple functions matter? Server Time
23 Apr 2024 15:39:17 EDT (-0400)
  Re: isosurface: Does the order of multiple functions matter?  
From: Kenneth
Date: 29 Jan 2023 11:55:00
Message: <web.63d6a43e9b90547b9b4924336e066e29@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> When you set some of the
> arguments to the PIG_DISTORTION_FUNC function to zero, you were
> either "sampling" this function in a plane, along a line or at a point.

Yes, the odd isosurface result looked kind of like 'cubes' joined together--
restricted to (or made up of) many x,y,z planes. The effect is actually hard to
describe.
>
> With pattern functions you can rewrite your isosurface function like
> this:
>
> function {
>     1 -
>     OBJECT_FUNC(
>         x + MAG*(DISTORTION_FUNC(    x, 1 - y, 1 - z) - 0.5),
>         y + MAG*(DISTORTION_FUNC(1 - x,     y, 1 - z) - 0.5),
>         z + MAG*(DISTORTION_FUNC(1 - x, 1 - y,     z) - 0.5)
>     )
> }

Originally, I did use -0.5 for the 'bias' (but unfortunately without the
additional parentheses you've added.) As the MAG multiplier value increased--to
bring in more of the bumps distortion-- I began to notice that the entire
distorted isosurface was shifting its position in space(!), along the vector
direction of <-1,-1,-1>. I didn't know if that was a result of something
specific to my current code; I had never noticed such movement before in a
normal isosurface. My 'informed guess' of using the *changing* -.5*MAG for the
bias eliminated that movement.

Now I see that the extra parentheses would have made -0.5 work as planned.
Thanks for pointing this out! It simply didn't occur to me... and would have
saved me a lot of coding grief.


Post a reply to this message

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