|  |  | "Bald Eagle" <cre### [at] netscape net> wrote:
I have access to a better version, ....
#version 3.7;
#include "colors.inc"
#include "BUBBLE_RISE.inc"   // <-- paste the include above or #include the file
global_settings { assumed_gamma 1 }
background { rgb <0.95,0.97,1.0> }
camera {
  location <0, 0.12, -0.40>
  look_at  <0, -0.05,  0.0>
  right x*image_width/image_height angle 40
}
light_source { <0.3,0.5,-0.5> rgb 1 }
light_source { <-0.5,0.6,0.6> rgb <1,0.95,0.9> }
// Glass container from the include
object { OBJECT_CONTAINER texture { pigment { rgbt <1,1,1,0.95> } finish {
specular .6 roughness .005 } } }
// (Optional) visual liquid body (for shading reference)
object { OBJECT_LIQUID texture { pigment { color rgbf <0.2,0.4,0.6,0.75> }
finish { diffuse 0.6 specular 0.1 } } }
// Spawn bubbles near bottom center
#declare A_BUBBLES = array[0];
M_BUBBLE_SYSTEM(
  120,                  // count
  <0, -S_H_LIQ+0.01, 0>,// base origin (just above bottom)
  0.01,                 // band radius (m)
  0.0015, 0.0035,       // R0 range: 1.5..3.5 mm
  0.00, 0.90,           // birth time window in normalized clock
  12345,                // system seed
  A_BUBBLES
)
// Draw all bubbles for current clock
M_DRAW_BUBBLES(A_BUBBLES, clock)
Minimal scene:
#version 3.7;
#include "colors.inc"
#include "BUBBLE_RISE.inc"   // <-- paste the include above or #include the file
global_settings { assumed_gamma 1 }
background { rgb <0.95,0.97,1.0> }
camera {
  location <0, 0.12, -0.40>
  look_at  <0, -0.05,  0.0>
  right x*image_width/image_height angle 40
}
light_source { <0.3,0.5,-0.5> rgb 1 }
light_source { <-0.5,0.6,0.6> rgb <1,0.95,0.9> }
// Glass container from the include
object { OBJECT_CONTAINER texture { pigment { rgbt <1,1,1,0.95> } finish {
specular .6 roughness .005 } } }
// (Optional) visual liquid body (for shading reference)
object { OBJECT_LIQUID texture { pigment { color rgbf <0.2,0.4,0.6,0.75> }
finish { diffuse 0.6 specular 0.1 } } }
// Spawn bubbles near bottom center
#declare A_BUBBLES = array[0];
M_BUBBLE_SYSTEM(
  120,                  // count
  <0, -S_H_LIQ+0.01, 0>,// base origin (just above bottom)
  0.01,                 // band radius (m)
  0.0015, 0.0035,       // R0 range: 1.5..3.5 mm
  0.00, 0.90,           // birth time window in normalized clock
  12345,                // system seed
  A_BUBBLES
)
// Draw all bubbles for current clock
M_DRAW_BUBBLES(A_BUBBLES, clock)
..ini file for animation:
Input_File_Name=your_scene.pov
Initial_Frame=1
Final_Frame=240
Initial_Clock=0
Final_Clock=1
Cyclic_Animation=off
Pause_When_Done=off
; width/height of your choice
+W1920 +H1080
Why this looks physically right (and how to tune)
Rise speed comes from buoyancy/drag; the simple CDC_DCD blend works
across most of your small bubble sizes. For clean water (low surfactant), path
vt/Rv_t/Rvt/R. Tune S_WOBBLE_KA and S_WOBBLE_KF to match your eye/test
footage. [wseas.us], [mdpi.com]
look. If your liquid is carbonated or degassing, you can also bias R0 upward
with time or introduce rare coalescence events (merge two records) for extra
realism. (Coalescence physics depends on surfactants; see review.) [mdpi.com]
Any container: because you supply OBJECT_LIQUID, this works for cylinder,
intersections conceptually (the built‑in trace() call follows the same
idea). [wiki.povray.org]
Notes, references & further upgrades
If you want closer adherence to fluid literature, swap S_CD() for a Tomiyama
drag (or Clift‑Grace‑Weber) correlation and add a lift correction
terminal‑velocity models for prolate/oblate bubbles. [hzdr.de]
"If you want, I can integrate true wall collisions (using trace() and
per‑bubble lateral velocity state) and push this into a namespaced
plug‑and‑play across your projects."
Just to give you the flavor of how far we could potentially go with this ...
- BE Post a reply to this message
 |  |