POV-Ray : Newsgroups : povray.newusers : Animating isosurfaces Server Time
4 Nov 2024 23:19:55 EST (-0500)
  Animating isosurfaces (Message 1 to 6 of 6)  
From: Jessie K  Blair
Subject: Animating isosurfaces
Date: 5 Sep 2004 00:43:17
Message: <413a9965$1@news.povray.org>
I'm running into an interesting issue with isosurface animation in 3.6

I've tried using phase, frequency, waves, bumps, and ripples in myriad ways
to simulate the motion of water for an isosurface, but no matter what I do,
the isosurface comes up with ugly, blocky plateaus usually right in the
middle of the animation.  Is there a way to animate an isosurface without
this problem?  Right now I'm trying to simply translate the wave pattern,
but it's simple unrealistic and severely limited.


Post a reply to this message

From: Florian Brucker
Subject: Re: Animating isosurfaces
Date: 5 Sep 2004 06:05:53
Message: <413ae501$1@news.povray.org>
Did you make sure your max_gradient is set high enough (check for 
warning messages in the message window) and that your waves do not get 
bigger than the container (so that they are cut)?

HTH,
Florian
-- 
Give a man a fish; you have fed him for today.
Teach a man to fish; and you have fed him for a lifetime.
Teach a man to sell fish and he eats steak. (Author unknown)
[------------ http://www.torfbold.com - POV-Ray gallery ------------]


Post a reply to this message

From: Jessie K  Blair
Subject: Re: Animating isosurfaces
Date: 5 Sep 2004 09:43:27
Message: <413b17ff@news.povray.org>
The water is contained within an object called Tank; I'm simply trying to
create motion surface for a more realistic fish tank animation.  Right now
the tank is the size of a 10 gallon, (20, 12, 10) with a glass thickness of
0.25 (Thus the Inner and Outer Width, Depth, and Height)  Here's the SDL:

// Water motion
#declare f_mwaves = function {
        pattern {
                waves
                phase clock
        }
}
#declare Water = intersection {
#declare Min_factor = 0.6;
        isosurface {
                function { y - f_mwaves(x, 0, z) }
                contained_by { box { -.5 * TankInnerWidth, .5 *
TankInnerWidth } }
                //evaluate 1.939*Min_factor,
sqrt(1.939/(1.939*Min_factor)),  0.7
                translate y * (TankInnerHeight - 1)
        }
        box {
                <-(.5 * TankInnerWidth), TankThickness, -(.5 *
TankInnerDepth)>
                <(.5 * TankInnerWidth), (TankOuterHeight + .1), (.5 *
TankInnerDepth)>
        }
        texture {
                pigment{ rgbf 1 }
                finish {
                        reflection {0.3, 1 fresnel}
                        conserve_energy
                        ambient 0
                        diffuse 0
                }
        }
        interior {
                ior 1.33
                media { absorption <.3, .4, .7> }
        }
        hollow off
}


I was playing with evaluate for the max_gradient problem, but it didn't fix
it so I commented it out.

"Florian Brucker" <tor### [at] torfboldcom> wrote in message
news:413ae501$1@news.povray.org...
> Did you make sure your max_gradient is set high enough (check for
> warning messages in the message window) and that your waves do not get
> bigger than the container (so that they are cut)?
>
> HTH,
> Florian
> -- 
> Give a man a fish; you have fed him for today.
> Teach a man to fish; and you have fed him for a lifetime.
> Teach a man to sell fish and he eats steak. (Author unknown)
> [------------ http://www.torfbold.com - POV-Ray gallery ------------]


Post a reply to this message

From: Thies Heidecke
Subject: Re: Animating isosurfaces
Date: 5 Sep 2004 15:01:54
Message: <413b62a2$1@news.povray.org>
Hi,
I think the problem is the waves pattern.
IIRC it looks ugly when phased in an unnatural way
because the only thing phase does with it, is to
bias it and the wrapping it to zero when it's value
would go higher than one.

For example compare:
plane {
  y, 0
  pigment { waves phase 0.0 }
}

and

plane {
  y, 0
  pigment { waves phase 0.5 }  // (or any other value for phase)
}

and you'll see what i mean.

a better way is to make your own waves pattern.
A quick start:

#declare f_mwaves = function(x,y,z,phse) {
  0.5*(1+cos(2*pi*(phse+sqrt(x*x+y*y+z*z))))
}

function{
  (f_mwaves((x-3)/3,(y-2)/5,(z+1)/4,5*clock) +
   f_mwaves((x+1)/4,(y+1)/6,(z-2)/7,6*clock) +
   f_mwaves((x-1)/5,(y-1)/4,(z+2)/6,7*clock)) / 3
}

This is a superposition of three radially travelling waves
with different center-points and scalings. It's a quick hack
but a nice start to build upon i think.

Thies


Post a reply to this message

From: Thies Heidecke
Subject: Re: Animating isosurfaces
Date: 5 Sep 2004 15:06:41
Message: <413b63c1$1@news.povray.org>
> #declare f_mwaves = function(x,y,z,phse) {
>   0.5*(1+cos(2*pi*(phse+sqrt(x*x+y*y+z*z))))
> }
>
> function{
>   (f_mwaves((x-3)/3,(y-2)/5,(z+1)/4,5*clock) +
>    f_mwaves((x+1)/4,(y+1)/6,(z-2)/7,6*clock) +
>    f_mwaves((x-1)/5,(y-1)/4,(z+2)/6,7*clock)) / 3
> }

Sorry, just looked over it again and saw that i
optimized it for a use as pigment-function.

For an isosurface something like this would be better:
#declare f_mwaves = function(x,y,z,phse) {
  cos(2*pi*(phse+sqrt(x*x+y*y+z*z)))
}

function{
  y -
  (f_mwaves((x-3)/3, (y-2)/5, (z+1)/4, 5*clock) +
   f_mwaves((x+1)/4, (y+1)/6, (z-2)/7, 6*clock) +
   f_mwaves((x-1)/5, (y-1)/4, (z+2)/6, 7*clock)) / 3
}

Thies


Post a reply to this message

From: Jessie K  Blair
Subject: Re: Animating isosurfaces
Date: 23 Sep 2004 11:35:27
Message: <4152ed3f@news.povray.org>
With some modification, this worked perfectly, thank you tremendously.

~Jessie

"Thies Heidecke" <h3i### [at] gmxnet> wrote in message 
news:413b63c1$1@news.povray.org...
>> #declare f_mwaves = function(x,y,z,phse) {
>>   0.5*(1+cos(2*pi*(phse+sqrt(x*x+y*y+z*z))))
>> }
>>
>> function{
>>   (f_mwaves((x-3)/3,(y-2)/5,(z+1)/4,5*clock) +
>>    f_mwaves((x+1)/4,(y+1)/6,(z-2)/7,6*clock) +
>>    f_mwaves((x-1)/5,(y-1)/4,(z+2)/6,7*clock)) / 3
>> }
>
> Sorry, just looked over it again and saw that i
> optimized it for a use as pigment-function.
>
> For an isosurface something like this would be better:
> #declare f_mwaves = function(x,y,z,phse) {
>  cos(2*pi*(phse+sqrt(x*x+y*y+z*z)))
> }
>
> function{
>  y -
>  (f_mwaves((x-3)/3, (y-2)/5, (z+1)/4, 5*clock) +
>   f_mwaves((x+1)/4, (y+1)/6, (z-2)/7, 6*clock) +
>   f_mwaves((x-1)/5, (y-1)/4, (z+2)/6, 7*clock)) / 3
> }
>
> Thies
>
>


Post a reply to this message

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