Hi Erwan, ah I did not know about cx and cy - good to know- BUT the whole thing is for a deep tool and cx and cy do not work in deep expressions. this also answers the question I am why not using the DepthToPosition node.
focal length and aperature size is considered by the c44Matrix node in projection mode. cheers, Vincent 2016-10-28 12:33 GMT+02:00 Erwan Leroy <er...@erwanleroy.com>: > Hi > Maybe you are doing it for the challenge, but is there a reason why you > would not use the DepthToPosition node built into Nuke? I seems to do > exactly what you are trying to do (I get a very small error which I believe > is due to rounding). > For the fun of it I looked into your expressions, but couldn't go all the > way through because there is no current build for the C44Matrix for Nuke 9 > on windows. > I have 2 things that I believe might be affecting your result (but I can't > verify): > > - I don't see you consider the focal length anywhere? That would have a > big impact. > > - Now this might not apply for every renderer, and Nuke's built in node > ignores that point as well: In your first expression, you generate a > "default" position point cloud, with X and Y as planar coordinated, while > possibly using a "curved" Z_Depth for you Z input. In real world (and Vray > for exemple) the distance a of a card right in front of a camera would not > have a single value, as the distance on the sides of the frame would be > greater than right in front of the camera. > See attached pictures that illustrate this point. > > (Also, for that first expression, why not using cx and cy instead of that > complex expression) > > > Cheers > > *Erwan* LEROY > www.erwanleroy.com > > On Fri, Oct 28, 2016 at 4:04 PM, Vincent Langer <m...@vincentlanger.com> > wrote: > >> Hi there, >> >> I am trying to get the math right calculating the worldpositions from z >> information + camera matrices. >> >> my result is close to the rendered position pass - but does not line up >> perfect. >> >> Maybe one of the brains out there can tell me what I am missing/doing >> wrong >> >> This is just a proof of concept for the right math and I use the >> C44Matrix node from Ivan Busquets. >> >> cheers, >> Vincent >> >> -- >> Vincent Langer >> Uhlandstr. 29 >> 71634 Ludwigsburg >> +49 176 965 177 61 >> www.vincentlanger.com >> >> _______________________________________________ >> Nuke-python mailing list >> Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ >> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >> >> > > _______________________________________________ > Nuke-python mailing list > Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python > > -- Vincent Langer Uhlandstr. 29 71634 Ludwigsburg +49 176 965 177 61 www.vincentlanger.com
_______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python