2
$\begingroup$

Given a pixel on the rendered image, is there any easy way to get the 3D location that the pixel corresponds to in the scene using python? i would really like to know before I go through trying to do the math to get it myself.

In case it makes a difference, I'm using an orthographic camera.

$\endgroup$
2
  • $\begingroup$ It is possible in the game engine, using the 'kx_camera.getScreenVect()' call. Not sure about the viewport. $\endgroup$
    – Mike Pan
    Feb 17, 2014 at 20:27
  • $\begingroup$ It's possible in the viewport too, but rendered image? Not sure... What is the application? $\endgroup$
    – CodeManX
    Feb 17, 2014 at 23:50

1 Answer 1

2
$\begingroup$

There are utility functions to convert 2d region coordinates to 3d:

bpy_extras.view3d_utils

There's also a method to cast a ray in the scene:

Scene.ray_cast

... but it might not work with orthographic view.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .