ctp
08-05-2008, 03:23 PM
Hello
I want to be able to have a 3d world space position (a locator) translated into a 2d screen space position.
The samplerInfo node has an attribute "pixelCenter" that seems to provide exactly that...
from the docs:
Pixel Center gives you the location of the pixel in the final image that corresponds to the point being sampled.
but how do I access these data?
I also looked at this script
http://www.185vfx.com/2003/03/convert-a-3d-point-to-2d-screen-space-in-maya/
but I found that if I work with an extreme device aspect ratio (like 2000 by 200 pixels) and I position an object exactly in the lower left corner of the resolution gate, it does not return exactly 0 for x and y. More like 0 and 0.4, meaning it thinks the y position is almost halfway into the total height of the image.
Any suggestions would be helpful.
thanks, C
I want to be able to have a 3d world space position (a locator) translated into a 2d screen space position.
The samplerInfo node has an attribute "pixelCenter" that seems to provide exactly that...
from the docs:
Pixel Center gives you the location of the pixel in the final image that corresponds to the point being sampled.
but how do I access these data?
I also looked at this script
http://www.185vfx.com/2003/03/convert-a-3d-point-to-2d-screen-space-in-maya/
but I found that if I work with an extreme device aspect ratio (like 2000 by 200 pixels) and I position an object exactly in the lower left corner of the resolution gate, it does not return exactly 0 for x and y. More like 0 and 0.4, meaning it thinks the y position is almost halfway into the total height of the image.
Any suggestions would be helpful.
thanks, C
