Reverse perspective

I use

worldview_inverse * (projection_inverse * vector)

to convert the coordinates of the screen space to world space coordinates. I suggested that

(x,y,1,1)

is converted to a point in the background, and

(x,y,-1,1)

converts to a point on the near plane, and by connecting the line, I can query all the objects in a truncated representation that intersect the line. After the conversion, I divide the resulting result points into their corresponding .w component. This works for the far plane, but the point on the near plane is somehow transformed into world cosmic origin.

I think this is due to the components of w 1, which I feed into the back projection, because usually it is 1 before the projection, and not after, and I do the back projection. What am I doing wrong?

+3
1

, , , .

near_point = view_position
           + (far_point - view_position) * (near_distance / far_distance)

. -, W! , (x, y, 0,1) z = -1.

near_point = worldview_inverse * (projection_inverse * vector)
near_point /= near_point.W
+4

Source: https://habr.com/ru/post/1703926/


All Articles