POV-Ray : Newsgroups : povray.general : Re: Overlapping multiple generated scenes : Re: Overlapping multiple generated scenes Server Time
29 Jul 2024 08:22:16 EDT (-0400)
  Re: Overlapping multiple generated scenes  
From: clipka
Date: 23 Apr 2012 16:23:31
Message: <4f95ba43@news.povray.org>
Am 23.04.2012 21:54, schrieb sic2:
>> 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).
>
>
> This is what I got:
>
> union {
>   sphere {
>    <-2, 0, -6>, 0.5
>   }
>
>   box {
>    <-1, -2, -5>,<  1,  2,  3>
>    rotate<0, -20, 0>
>   }
>   pigment {
>    gradient x
>    pigment_map {
>     [ -10 White]
>     [ 100 Black ]
>    }
>   }

The value range for any pattern is always 0..1, so you'll need to use

   pigment_map {
     [0.0 White]
     [1.0 Black]
   }

For the gradient to cover the proper range, scale (and possibly 
translate) the pigment, as in

   pigment {
     gradient x
     pigment_map {...}
     scale <110,1,1>
     translate -10*x
   }

> Also do you know if it's possible to create a gray map of just depth Z lets say
> (or from depth Z_1 to Z_2) ? I need an answer for the second question for post
> processing the image later.

I don't really understand what you mean. Maybe it would help if you 
described what you are ultimately trying to achieve with all of this.


Post a reply to this message

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