POV-Ray : Newsgroups : povray.animations : Isosurface 'water' but it goes concave : Re: Isosurface 'water' but it goes concave Server Time
28 Jul 2024 10:20:17 EDT (-0400)
  Re: Isosurface 'water' but it goes concave  
From: John D  Gwinner
Date: 8 Jul 2001 12:28:40
Message: <3b488a38$1@news.povray.org>
Mike:

Maybe I'm doing something wrong, but actually, y+WrinklesFunc doesn't work -
it's basically what I tried before (I used y-).  It looks fine as a single
frame, but when you animate it the surface goes down.  I'm posting the
animation in news:news.povray.org/povray.animations  (not sure if that will
work)(Finally in MPEG format, using TMPGE).

I'm including the scene file below your post.  I blended the sine wave and
the color map issues however, might take that out.  I made the wave depth
slightly larger too.

#version unofficial MegaPov 0.7;

#declare R=1.0;
#declare R1=R+0.01;
#declare Box = 1;

camera { location  <5*R, 5*R, -8*R> look_at <0, 0, 0> angle 20}

sky_sphere { pigment {
    gradient y
    color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  }
}

light_source {<100,200,-100> colour rgb 1}
light_source {<-100,200,100> colour rgb 1}


#declare WaveDepth = 1;

#declare WrinklesFunc =
function {
    pigment {wrinkles phase clock
        color_map {
   [ clock-1 color rgb 1]
                   [clock   color rgb 0]
                   [clock+1 color rgb 1]

        } sine_wave //frequency -1
      scale .2
    translate <1, 0, 0>
    turbulence .1
    }
}

isosurface {
    function {
        y + WrinklesFunc(x,z,y) * WaveDepth/10

      }
    contained_by{box <-R,-R,-R> <R, R, R>}


    pigment {rgb <.2 .2 .9 >}
    finish {phong 0.5 phong_size 10}
}





"Mike Williams" <mik### [at] nospamplease> wrote in message
news:3SJ### [at] econymdemoncouk...
> Wasn't it Bob H. who wrote:
> >"John D. Gwinner" <jgw### [at] hotmailcom> wrote in message
news:3b4778d1$1@news.p
> >ovray.org...
> >>
> >>   The closest I have so far is an Isosurface, which looks good but when
I
> >> animate it I get something odd: 'phase' identifier in the wrinkles (or
waves
> >> or ripples) causes the surface to move *down* not across, so it causes
a
> >> concavity.  I tried different combinations of functions, rotations,
etc. and
> >> it doesn't seem to work.   An example - I replaced 'clock' in the phase
with
> >> a .5 so you can see what it looks like.
> >
> >Changed your script code around a little and got a nice little water
surface
> >showing caustics on
> >the ground below the isosurface.
> >
> >
> > I'm not savy enough to know why there is a overall concave surface, as
> > seen when wrinkles is used instead of ripples.  Mystery to me, sorry I
> > couldn't solve that.  However the surface does move in a way which you
> > wanted I believe. I animated it with that ripples pattern and it
> > looked right enough to me.  Well, I take that back, looks like
> > something's wrong with the container bounds but I'm not sure.
>
> The concavity is due to subtracting a sphere from the function. You've
> got
>
>     function {
>         y-(sqrt(sqr(x) + sqr(y) + sqr(z))// - 1
>          - WrinklesFunc(x, y, z) * WaveDepth)/10
>     }
>
>          which is   plane - (sphere - Wrinkles)/10
>
> The concavity effect looks more pronounced when you use wrinkles because
> the ripples are higher than the wrinkles. You can see the underlying
> concavity more clearly of you temporarily set the WaveDepth to zero.
>
> If we get rid of the spherical component
>
>     function {
>         y + WrinklesFunc(x, y, z) * WaveDepth/10
>     }
>
>          then we get ripples on a flat surface instead of a concave one.
>
> Your fix for the main problem - adding sine_wave to the WrinklesFunc -
> declaration also works for the wrinkles pattern, and is rather more
> elegant than my shifting of the colour_map in phase with the clock.
>
> Your container looks fine to me.
>
> --
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

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