POV-Ray : Newsgroups : povray.text.scene-files : Fake Water Depth Server Time
31 Oct 2024 21:21:49 EDT (-0400)
  Fake Water Depth (Message 1 to 1 of 1)  
From: Bob Hughes
Subject: Fake Water Depth
Date: 30 Apr 1999 10:06:10
Message: <3729AA82.7F5D7DBA@aol.com>
For POV-Ray 3.02, a few semi-colons added and ior moved to interior and
should be okay for 3.1 too. Sloppy script from me of course as usual.


// Persistence of Vision Ray Tracer Scene Description File
// File: watrdpth.pov
// Vers: 3
// Desc: Test of water depth color, surface ripples, angle dependant
reflection
// Date: 98.4, 98.6 (99.34)
// Auth: Bob Hughes <mailto://inversez@aol.com?Subject=PoV-Scene>

//animation variables
#declare _C_ = .75 //clock
#declare _cC_ = .5 //clock
#declare _rC_ = .5 //clock

global_settings {
assumed_gamma 2.2
ambient_light <1.5,1.5,1.5>*.825
max_trace_level 8
 }

#if (_C_<.5)  //clock 0 to 1
#declare _oC_ = (2*_C_)+.00001  //object scaling
#declare _nC_ = _oC_  //normal amount
#else
#declare _oC_ = 1
#declare _nC_ = 1-((2*_C_)-1)+.00001
#end
#declare _pC_ = 2*clock //2*_C_  //phasing

// LIGHTS/CAMERA
#declare LCX = -5
#declare LCY = 0
#declare LCZ = -12

light_source { <5,5,15> color rgb <.9,.8,.7>*.9}
light_source { <12,12,-9> color rgb <1.1,1.2,1.3>*1.5}

#declare CAMH = 90*_cC_  //camera rotation around x axis

camera {
  location <LCX,LCY,LCZ>
  angle 36 //23.456
  up 1*y right 4/3*x
 rotate CAMH*x
  look_at <0,-.825,-.125> //<.2, -1.2345, 0>
}

//SKY
sky_sphere {pigment {gradient y color_map {
           [0,.25 color rgb<.1,.1,.1> color rgb<.4,.2,.1>*1.5]
           [.25,.5 color rgb<.4,.2,.1>*1.5 color rgb<.5,.5,0>*1.5]
           [.5,.75 color rgb<.5,.5,0>*1.5 color rgb<.25,.125,.5>*1.5]
           [.75,1 color rgb<.25,.125,.5>*1.5 color rgb<.125,.125,.125>]
           } } rotate 60*x
}

#declare WR = .3333+(.6666-(.6666*_rC_))  //water reflection

//WATER CUBICAL
union {

difference {
box {<-2,-2,-2>,<2,0,2>
texture {
 pigment {gradient y turbulence 0 frequency -1 //reverse frequency
  color_map {
   [0 color rgbf<.35,.45,.5,.1>]
   [.25 color rgbf<.45,.55,.6,.3>]
   [.5 color rgbf<.55,.65,.7,.7>]
   [.75 color rgbf<.65,.75,.8,.9>]
   [1 color rgbf<.75,.85,.9,1>*1]
   } scale 2 }
 normal {average normal_map {
        [1*_nC_ ripples .75*_nC_ phase _pC_ frequency -1 turbulence
.2+(1-_C_) scale .33]
        [.25*_nC_ ripples 1*_nC_ phase _pC_ frequency 1 turbulence
.3+(1-_C_) scale .36 scallop_wave]
        [.75*_nC_ ripples .75*_nC_ phase _pC_ frequency -1 turbulence
.2+(1-_C_) scale .33 translate 2*x]
        [.125*_nC_ ripples 1*_nC_ phase _pC_ frequency 1 turbulence
.3+(1-_C_) scale .36 translate 2*x scallop_wave]
        [.75*_nC_ ripples .75*_nC_ phase _pC_ frequency -1 turbulence
.2+(1-_C_) scale .33 translate -2*x]
        [.125*_nC_ ripples 1*_nC_ phase _pC_ frequency 1 turbulence
.3+(1-_C_) scale .36 translate -2*x scallop_wave]
        [.75*_nC_ ripples .75*_nC_ phase _pC_ frequency -1 turbulence
.2+(1-_C_) scale .33 translate 2*z]
        [.125*_nC_ ripples 1*_nC_ phase _pC_ frequency 1 turbulence
.3+(1-_C_) scale .36 translate 2*z scallop_wave]
        [.75*_nC_ ripples .75*_nC_ phase _pC_ frequency -1 turbulence
.2+(1-_C_) scale .33 translate -2*x]
        [.125*_nC_ ripples 1*_nC_ phase _pC_ frequency 1 turbulence
.3+(1-_C_) scale .36 translate -2*x scallop_wave]
 } }
  finish {ambient 0 diffuse .2 specular .9 roughness .0005
  reflection WR refraction 1 ior 1.33 caustics .05 //fade_distance 1.5
fade_power 1
  }
 }
}

//SUBTRACT OBJECTS
cone{-2*y,(.5+(1.25*_oC_)),(-.4+(1.36*_oC_))*y,0 pigment {rgbf<1,1,1,1>}
scale 1.01}
box {<-2,-2,-2>,<2,0,2> inverse pigment {rgbf<1,1,1,1>} scale <.99,1,.99>
translate .01*y}
}//end difference

//VISIBLE OBJECTS
//reflection test object
torus {.75,.125 translate 1*y pigment {rgb 1.25}
 finish {ambient .3 diffuse .3 phong .432 phong_size 123 reflection .2}
}
//water depth test object
cone{-2*y,(.5+(1.25*_oC_)),(-.4+(1.36*_oC_))*y,0
 pigment {rgb _C_}  //color goes from black to white
  finish {ambient .2 diffuse .6 phong .432 phong_size 123 reflection .2}
}
//water
box {<-2,-2,-2>,<2,0,2>
texture {
 pigment {gradient y turbulence 0 frequency -1 //reverse frequency
  color_map {
   [0 color rgbf<.35,.45,.5,.1>]
   [.25 color rgbf<.45,.55,.6,.3>]
   [.5 color rgbf<.55,.65,.7,.7>]
   [.75 color rgbf<.65,.75,.8,.9>]
   [1 color rgbf<.75,.85,.9,1>]
   } scale 2 }
  finish {ambient 0 diffuse .2 specular .9 roughness .0005
  reflection .4 refraction 1 ior 1.33 caustics 1 //fade_distance 1.5
fade_power 3
  }
 }
 scale <.999,1,.999> translate -.001*y
  clipped_by {box {<-2,-2,-2>,<2,0,2> inverse scale .99}}
}
//water tank edges
union {
cylinder {-2*y,0*y,.05 translate <2,0,2>}
cylinder {-2*y,0*y,.05 translate <-2,0,2>}
cylinder {-2*y,0*y,.05 translate <-2,0,-2>}
cylinder {-2*y,0*y,.05 translate <2,0,-2>}
cylinder {-2*x,2*x,.05 translate <0,0,2>}
cylinder {-2*x,2*x,.05 translate <0,0,-2>}
cylinder {-2*z,2*z,.05 translate <-2,0,0>}
cylinder {-2*z,2*z,.05 translate <2,0,0>}
cylinder {-2*x,2*x,.05 translate <0,-2,2>}
cylinder {-2*x,2*x,.05 translate <0,-2,-2>}
cylinder {-2*z,2*z,.05 translate <-2,-2,0>}
cylinder {-2*z,2*z,.05 translate <2,-2,0>}
sphere {0,.05 translate <2,0,2>}
sphere {0,.05 translate <-2,0,2>}
sphere {0,.05 translate <2,0,-2>}
sphere {0,.05 translate <-2,0,-2>}
sphere {0,.05 translate <2,-2,2>}
sphere {0,.05 translate <-2,-2,2>}
sphere {0,.05 translate <2,-2,-2>}
sphere {0,.05 translate <-2,-2,-2>}
 pigment {rgb<.6,.63,.66>}
  finish {ambient .2 diffuse .2 metallic .7 brilliance 1 specular .4
roughness .01
  reflection .8}
}
}//end union


-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/homepage.htm
 mailto:inv### [at] aolcom?Subject=PoV-News


Post a reply to this message

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