3
$\begingroup$

Using a Blender python script I want to get the world coordinate of a specific pixel (or all).

Assume a camera has been defined (focal length, fov/angle, sensor size,etc.), and orientated/pointed as desired. Also, a large surface is defined, so the camera rays would actually "hit" objects in the scene (& not cast into infinity).

For example, Given 4 corners pixels of camera, where do they in fall in world coordinates (XYZ)?

Alternatively, a script could export the world coordinates (XYZ) for all pixels, then a "camera ray hit map" could be generated. There's probably a better name for this.

From the very similiar question, "Get location in scene for pixel?", there are recommendations to use:

bpy_extras.view3d_utils & Scene.ray_cast

However I'm new to blender, and ray-tracing in general, and it is not clear to me how to proceed with these functions.

$\endgroup$