POV-Ray : Newsgroups : povray.general : Water ripples !!! : Re: Water ripples !!! Server Time
13 Aug 2024 23:25:26 EDT (-0400)
  Re: Water ripples !!!  
From: Mathias Broxvall
Date: 13 May 1998 17:24:00
Message: <1d8znra.1afn7nszkeqesN@dialup78-2-26.swipnet.se>
Kent Friberg <kef### [at] NoSpamThanxonlineno> wrote:

> Hi Oliver,
> check out the thread you started in povray.binaries.animations
> 
> The conclusion was that the phase statement DO NOT alter the surface in any
> way, it just LOOKS like the waves are there, another approach (not directly
> in POV?) is needed I'm afraid....
>

How about using the isosurface patch to represent the water surface 
with a function. Try this:

// Persistence of Vision Ray Tracer Scene Description File
// File: ripples.pov
// Vers: Isosurface patch
// Desc: Some simple ripples
// Date: 980513
// Auth: Mathias Broxvall

#include "Colors.inc"
#include "Skies.inc"

camera {
  location  <0.0 , 12.0 ,-16.0>
  look_at   <0.0 , 1.0 , 1.5>
}

light_source { <0,20,0> color rgb 1 }

#declare STRENGTH1 = 1.0
#declare SCALE1 = 1.0
#declare OFFSET1 = clock*5.0
#declare CENTER1_X = -6.0
#declare CENTER1_Z = 0.0

#declare STRENGTH2 = 0.7
#declare SCALE2 = 1.0
#declare OFFSET2 = clock*5.0
#declare CENTER2_X = 7.0
#declare CENTER2_Z = 3.0

#declare wave1Fun = function { STRENGTH1 / (x+1+OFFSET1) * sin(SCALE1 *
(x-OFFSET1)) }
#declare wave1 = function { wave1Fun(sqrt(sqr(x - CENTER1_X)+sqr(z -
CENTER1_Z)),0,0) }

#declare wave2Fun = function { STRENGTH2 / (x+1+OFFSET2) * sin(SCALE2 *
(x-OFFSET2)) }
#declare wave2 = function { wave2Fun(sqrt(sqr(x - CENTER2_X)+sqr(z -
CENTER2_Z)),0,0) }

#declare foo = function { y - 1 + wave1(x,y,z) + wave2(x,y,z) }

isosurface {
  function { foo }
  bounded_by {box{<-50,0,-50>,<50,2,50>}} 
  pigment { color rgb <0.5,0.5,1.0> }
  finish {
    phong 0.5
    //metallic
  }
  scale <1,2,1> // lets exagerate it!
  translate <0,1,0>
}

/ Mathias Broxvall


Post a reply to this message

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