[Radiance-general] 3d Depth of a pixel
Brajesh Lal
brajeshlal at yahoo.com
Fri Mar 18 02:36:32 PDT 2011
Hi Lars/ Greg,
I tried with small expression in a cal file.
As i know camera position and Camera view direction from camera.vp file.
I suppose rpict is similar to rtrace in terms of internal processing.
The depth of the 3d point will be = T *cos theta
I suppose " T " returns distance from camera to point of intersection as per
rayinit.cal
If CP = Normalized Vector from camera to Point of intersection ( Px, Py, Pz)
cos theta = (CP) dot product (normalized view vector)
therefore my cal file has
{
3dDepthshader.cal
}
red=T * ( (CPx * ViewX)+CPy * ViewY)+Cpz * ViewZ)) ;
is the correct way to compute ?
Anyway i will try with your given techniques too.
Best Regards, Brajesh Lal
________________________________
From: Greg Ward <gregoryjward at gmail.com>
To: Radiance general discussion <radiance-general at radiance-online.org>
Sent: Thu, March 17, 2011 4:40:42 PM
Subject: Re: [Radiance-general] 3d Depth of a pixel
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
_______________________________________________
Radiance-general mailing list
Radiance-general at radiance-online.org
http://www.radiance-online.org/mailman/listinfo/radiance-general
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.radiance-online.org/pipermail/radiance-general/attachments/20110318/24b1cbcf/attachment.html>
More information about the Radiance-general
mailing list