POV-Ray : Newsgroups : povray.advanced-users : Raindrops on bombshells : Raindrops on bombshells Server Time
2 Nov 2024 05:21:46 EDT (-0400)
  Raindrops on bombshells  
From: Lummox JR
Date: 22 Mar 2000 23:20:39
Message: <38D99CF0.6CFC@aol.com>
I'm trying to flesh out a scene which will have an unexploded bomb lying
in the mud in a rain storm. I've got a nice media for the background
rain, I think, and the scenery is starting to look good, but the bomb
will need to be in the foreground so it has to look like it's been
rained on. Right now I'm designing the bomb apart from the rest of the
scene.
The raindrops use the same isosurface function for the bomb head, but
also slightly modified so that they'll cover the cylindrical section
from 0 to y as well as the tip of the bomb which extends from y to y*2.
(The bomb extends from 0 to y*2, radius 0.5.) Noise is included in the
radius portion of the formula; the bumps that stick out past the bomb
itself are supposed to look like raindrops.
At one point I got the raindrops to look somewhat decent, but some quick
tweaking and they were all screwed up again. I found that when I render
this scene, the raindrops (more like squiggly pools of water) appear to
be more or less black instead of showing through to the chromed bomb
surface; more to the point, they looked like the rays that hit the water
were passing through the bomb completely. I put this in a union because
that made the most sense, but originally the raindrops and the bomb were
separate objects (which didn't work either). My thinking was that in a
union, the inner intersections would be accounted for and thus it would
look right--but perhaps something about the hollowness of the water
surface throws that off.

I'm sure this concept of putting raindrops on a surface is nothing new
under the sun, so if anyone has any insights that would help, I'd
appreciate it. It may be that I'm just going about this all wrong and
should try a different approach.

Lummox JR
------------
// Segment of testbomb.pov
...
// bozo(x,y,z) is an unclipped noise function, like noise3d()-0.5
// if(a,b,c) appears in MegaPOV and is defined as (a>=0)?b:c

#declare raindrops=intersection {
    isosurface {
        function {4*(sqr(x)+sqr(z)-cub(bozo(x*20,y*20,z*20)-0.35)*0.01)+
          if(y-1,-((y-3)*sqr(y-1)+1),-1)}
        accuracy 0.0001
        bounded_by {box {<-0.6,0,-0.6>,<0.6,2.1,0.6>}}
        }
    plane {-y,0}
    texture {
        pigment {color rgbt 1}
        finish {Shiny}
        }
    interior {ior 4/3}
    }

union {
    object {raindrops}
    merge {
        isosurface {
            // 4*(sqr(x)+sqr(z)=(1-(y-1))
            // 4*(sqr(x)+sqr(z)=(y-1)*(1-(y-1))+(1-(y-1))*(1-sqr(y-1))
            function {4*(sqr(x)+sqr(z))-((y-3)*sqr(y-1)+1)}
            accuracy 0.0001
            normal
            bounded_by {box {<-0.6,1,-0.6>,<0.6,2.1,0.6>}}
            }
        cylinder {0,y,0.5}
        intersection {
            merge {
                quadric {<400,0,4>,<0,0,0>,<0,1,0>,-1 translate z*0.25}
                quadric {<400,0,4>,<0,0,0>,<0,1,0>,-1 translate z*0.25
rotate y*120}
                quadric {<400,0,4>,<0,0,0>,<0,1,0>,-1 translate z*0.25
rotate -y*120}
                }
            merge {
                plane {-y,0}
                intersection {quadric {<-1,1,-1>,<0,0,0>,<0,-1,0>,0.25}
plane {y,0.5} plane {-y,0.5}}
                }
            bounded_by {cylinder {-y*0.51,y*0.751,0.751}}
            }
        }
    texture {
        Chrome_Texture
        pigment {
            function {if(-z,labelpigment(atan(-x/z)*0.5,y-0.75,1),0)}
            color_map {
                [0.1 color LightGray]
                [0.4 color rgb<1,0.9,0.1>]
                [0.6 color rgb<1,0.9,0.1>]
                [0.9 color Black]
                }
            }
        finish {
            ambient 0.3
            diffuse 0.7
            reflection 0.3
            brilliance 8
            specular 0.8
            roughness 0.1
            }
        }
    }


Post a reply to this message

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