[Radiance-general] 3d Depth of a pixel

Greg Ward gregoryjward at gmail.com
Thu Mar 17 08:40:42 PDT 2011


Hi Brajesh,

Lars is right that you can use vwrays with rtrace to get more flexible output.  The Z-buffer file is a string of binary floats, and not formatted as such.  You need to pass it through pvalue if you want to produce a (grayscale) image.  You can use the following sequence if you like:

	rpict -x ResX -y ResY -z  depth.zbf  -vf  camera.vp  scene.oct > scene.hdr
	pvalue -r -h -df -b `getinfo -d < scene.hdr` depth.zbf > depth.hdr

Notice the back-quotes above, which substitute the resolution output of getinfo -d on the command line.  You can then view "depth.hdr" as a grayscale image or convert to color using falsecolor:

	falsecolor -l Depth -s auto -m 1 -i depth.hdr > depth_fc.hdr

If you don't want the grayscale image at all, you can combine your pvalue and falsecolor commands like so:

	pvalue -r -h -df -b `getinfo -d < scene.hdr` depth.zbf | falsecolor -l Depth -s auto -m 1 > depth_fc.hdr

Best,
-Greg

> From: Brajesh Lal <brajeshlal at yahoo.com>
> Date: March 17, 2011 4:33:10 AM PDT
> 
> Hi, 
> 
> I need to know the z depth of  each 3d point. I want an output image such that color of each pixel stores the info of z-depth of the corresponding pixel . 
> in rpict i am confused in syntax. How do i use -z option ?
> 
> e.g.
> rpict -x ResX -y ResY -z  depth.hdr  -vf  camera.vp  scene.oct > scene.hdr    ????
> 
>  
> Best Regards, 
> Brajesh Lal



More information about the Radiance-general mailing list