POV-Ray : Newsgroups : povray.newusers : Media or CSG error? : Re: Media or CSG error? Server Time
2 Nov 2024 03:13:21 EDT (-0400)
  Re: Media or CSG error?  
From: Mike Williams
Date: 16 Oct 2004 02:15:44
Message: <ycTvoFAByLcBFwpd@econym.demon.co.uk>
Wasn't it Soace Munky who wrote:
>Since I'm new to both, its hard to destinguish. Im trying to experiment 
>with media by placing a smoke-filled glob inside water.
>
>#declare Media =
>media {
>       emission 0.05
>       intervals 1
>       samples 5
>       method 3
>}
>difference {
>box {<-4,-1,-1><4,1,1>
>      material {water}
>     }
>isosurface {
>         function { f_sphere(x, y, z, 1.2) + f_noise3d(x+X, y+Y, z+Z) }
>         contained_by {sphere {< 0, 0, 0>, 1}}
>               interior { media { Media } }
>             }
>hollow
>}
>
>I dont see anything... My guess is that I cant set up proper parameters, 
>or I defined the CSG setup wrong for media.
>Any help greatly apprecited.

The problem is that you haven't made the isosurface transparent, so you
can't see the media inside it. Either add a transparent texture to the
isosurface itself or move the "material {water}" so that it applies to
the whole CSG rather than just to the box.

In this particular case you seem to be able to get away without using
"all_intersections" or "max_trace" in the isosurface, but I suggest
setting a sensible value for max_trace anyway.

To get rid of the little holes in the isosurface, set an appropriate
value for max_gradient.

#declare Media =
media {
  emission 0.05
  intervals 1
  samples 5
  method 3
}
difference {
  box {<-4,-1,-1><4,1,1>}
  isosurface {
    function { f_sphere(x, y, z, 1.2) + f_noise3d(x+X, y+Y, z+Z) }
      contained_by {sphere {< 0, 0, 0>, 1}}
      max_trace 4               // for isosurface CSG
      max_gradient 1.6          // to prevent holes
    interior { media { Media } }
    }
  material {water}              // applies to box and isosurface
  hollow
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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