POV-Ray : Newsgroups : povray.general : Depth Maps : Re: Depth Maps Server Time
7 Aug 2024 05:12:57 EDT (-0400)
  Re: Depth Maps  
From: Rune
Date: 11 Jan 2002 16:11:20
Message: <3c3f54f8@news.povray.org>
"Chris Howie" wrote:
> I have to admit, that DOES sound easy...
> could you send me some source I could examine?

Here's a quick example I just made:

// Camera and depth alignment
// **************************

// Camera alignment
#declare CamAlignment =
transform {translate -5.5*z rotate <20,35,0> translate 1.2*y}

// Depth range
#declare MinDepth = 3;
#declare MaxDepth = 9;

// Makes areas closer than depth range red
// and areas farther away than depth range blue.
#declare ErrorTest = off;

// Depthmap mode on/off.
#declare Stereogram = on;

// 'Stereogram generator'
// **********************

camera {location 0 look_at z transform CamAlignment}

#if (Stereogram=on)
   #default {
      texture {
         pigment {
            planar rotate 90*x scale MaxDepth
            color_map {
               [0.0001, blue ErrorTest]
               [0.0001, rgb 0]
               [1-MinDepth/MaxDepth-0.0001, rgb 1]
               [1-MinDepth/MaxDepth-0.0001, rgb 1-<0,1,1>*ErrorTest]
            }
         }
         finish {ambient 1 diffuse 0}
         transform CamAlignment
      }
   }
   background {rgb ErrorTest*<0,0.5,1>}
#else
   #default {pigment {rgb 1}}
#end

// Objects in scene
// ****************

plane {y, 0} // floor
union { // table
   box {<-1,0,-1>, <1,1,1> scale <0.1,2,0.1> translate <+2,0,+1>}
   box {<-1,0,-1>, <1,1,1> scale <0.1,2,0.1> translate <-2,0,+1>}
   box {<-1,0,-1>, <1,1,1> scale <0.1,2,0.1> translate <+2,0,-1>}
   box {<-1,0,-1>, <1,1,1> scale <0.1,2,0.1> translate <-2,0,-1>}
   box {<-2.2,2,-1.2>, <2.2,2.2,1.2>}
}
union { // ugly quick lamp
   sphere {0.3*y, 0.3}
   cone {0.5*y, 0.45, 1.0*y, 0.1}
   translate <1,2.2,0.5>
}

// Only for testing purposes when stereogram mode is turned off.
light_source {<1,2,-3>*1000, color 1}

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Jan 2)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

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