POV-Ray : Newsgroups : povray.binaries.images : using 'object pattern' as media : Re: using 'object pattern' as media Server Time
26 Apr 2024 01:07:54 EDT (-0400)
  Re: using 'object pattern' as media  
From: Kenneth
Date: 7 May 2022 17:00:00
Message: <web.6276dab9ac9c0ae12eadabda6e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

>
> I plan to post the basic code for these examples...

Here are the basics for the most simple kind of example, using just scattering
media. A light_source is required to show this type of media in the best way, of
course.

BTW, the docs says that the object used for the object pattern must not have a
texture, but that does not matter. The texture is simply ignored.

...............
#declare OBJ = ...object...  // to be used as the object pattern. Mesh and mesh2
require an inside_vector. CSG works too, but all of the parts should be
'merged' rather than in a union.

#declare OBJ_PATTERN =
density{
   object{
         OBJ

        // For the following two entries, full pigments are not allowed when
        //'density' is used for the pattern:

        // FIRST entry: everywhere OUTSIDE the 'object' shape
        rgb 0.0 // 0 means NO media density-- i.e., no visible media there

        // SECOND entry: INSIDE the object shape
        rgb 1.0  // 1 means 'full density' in the media
         }
                warp{turbulence...}
 }

// the required media container
sphere{...  // or box, etc.
hollow
pigment{rgbt 1} // or rgb 1 transmit 1
interior{
     media{
           scattering{1, multiplier * <...color...> extinction...}
        // I used 16*<1,1,1> extinction 0.5

        // emission ...
        // absorption ...

        //method 3
        //intervals 1
          samples ...
          aa_level ... // 4 is the default
          density{OBJ_PATTERN}
         }
       }
rotate ...
translate...
} // end of container object


Post a reply to this message

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