PDA

View Full Version : Help faking depth-map


PlebianX
03-09-2004, 06:36 PM
hello!

I've got a project I'm working on using a 3rd party plug-in for after effects, and I'm having some problems. Mental Ray refuses to give me a Z-Depth no matter what I select or what format I use(IFF, RLA, etc.) and the plug-in can only use grey-scale pictures of built-in z-channels. So I've given everything a pure white color, and put this
$temp1 = samplerInfo1.pointWorldX - samplerInfo1.pointCameraX;
$temp2 = samplerInfo1.pointWorldY - samplerInfo1.pointCameraY;
$temp3 = samplerInfo1.pointWorldZ - samplerInfo1.pointCameraZ;
$temp4 = mag(<<$temp1,$temp2,$temp3>>);
if($temp4<0){$temp4=$temp4*-1;}
lambert2.incandescenceR = $temp4/100;
in each incandescenceR/G/B changing variable names accordingly. This gives the EXACT right effect, except going from 0,0,0 instead of the camera. Any help GREATLY appreciate by both me and my client! :beer:

PlebianX
03-09-2004, 08:10 PM
D'oh!!
replaced the code with
$temp1 = samplerInfo1.pointWorldX - camera2.translateX ;
$temp2 = samplerInfo1.pointWorldY - camera2.translateY ;
$temp3 = samplerInfo1.pointWorldZ - camera2.translateZ ;
$temp4 = mag(<<$temp1,$temp2,$temp3>>);
if($temp4<0){$temp4=$temp4*-1;}
lambert2.incandescenceB = $temp4/100;

and víola!

CGTalk Moderation
01-17-2006, 04:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.