POV-Ray : Newsgroups : povray.general : Re: Overlapping multiple generated scenes : Re: Overlapping multiple generated scenes Server Time
29 Jul 2024 08:20:25 EDT (-0400)
  Re: Overlapping multiple generated scenes  
From: clipka
Date: 23 Apr 2012 10:27:33
Message: <4f9566d5$1@news.povray.org>
Am 23.04.2012 15:30, schrieb sic2:
> This is the code I have written so far:
>
> #declare Index = 0;
> #declare offset_index = 30;
>
> #while(Index<  90)
>    difference {
>
>     sphere {
>             <1, 0, -6>, 0.5
>             finish {
>                     ambient 0.1
>                     diffuse 0.6
>             }
>             pigment { NeonPink }
>     }
>    // Cutting plane
>    #declare rgb_coeff = 255;
>    plane {
>     // http://www.povray.org/documentation/view/3.6.0/297/
>     <0, 0, 1>, -7 // This will vary depening on the index
>     pigment {
>                    rgb<Index/rgb_coeff, Index/rgb_coeff, Index/rgb_coeff>
>            }
>           translate<0, 0, 1>
>    }
>
>
>    }  // end difference
>          #declare Index = Index + offset_index;
> #end // end while-loop
>
>
>
> What I am aiming to get is to cut the same scene multiple times at different
> depths and getting the cut scene (the scene is cut using a plane). Then I want
> to take all the cut scenes (from the one cut to its farthest point to the one
> cut at its closest point) and overlap all of them.
> I should then get a depth map with different grays like this one:
> http://www.dofpro.com/tutorials/chessDM.jpg
>
> How do I go about getting the different cut scenes and put all of them
> together?
>
> Thank you very much in advance.

If all you want is a depth map, a much easier, faster and qualitatively 
superior approach is to simply use a corresponding texture.

Comment out any textures already applied to your objects (or use an 
"#if...#end" construct). Place all your objects into a single union, and 
equip that one with a texture having an "emission 1 ambient 0 diffuse 0 
specular 0 phong 0" finish (in POV-Ray 3.6, use "ambient 1" instead of 
"emission 1 ambient 0"), and a gradient or planar pigment fading from 
white (near the camera) to black (far away from the camera).


Post a reply to this message

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