Question about cross API interpretation of the view_proj matrix.

Started by
2 comments, last by Zakwayda 14 years, 7 months ago
Hello, I have a question about the cross-API interpretations of the view * projection matrix. Ok, so it is my understanding that the view matrix describes the translation and rotation of the viewer. The projection matrix then accounts for projection/depth fov etc. So, the view * projection matrix then is used to transform a frustum viewing region into a cuboid shape aligned along the axes etc. In DirectX it is my understanding that this resulting cuboid shape has the extents (1, 1, 0.5) and is centered at (0, 0, 0.5). Question) Do all APIs (DirectX, OpenGL etc.) use the same cuboid extents and centering after the view * projection transformation? I would like to know this because for certain calculations such as finding the corners of the view plane in world space it would seem to be the most simple solution to simply transform the coordinates (1, 1, 0), (-1, 1, 0), (1, -1, 0), (-1, -1, 0) by the inverse of the view * projection matrix but this is dependent on the fact that all APIs when transformed by the view_proj create the same cuboid extents, location and orientation. Thank you for your help. Jeremy
Advertisement
Update -

I finally found the information I was needing I believe.

In DirectX the extents of the cuboid are (1, 1, 0.5) with center at (0, 0, 0.5) and in OpenGL they are (1, 1, 1) with center at (0, 0, 0).

So, to transform points on the cuboid to world space you would need to handle cross API stuff.

If anyone has any additional information I would love to hear it.
Jeremy
Update -

Does anyone know the technical name of the cuboid shape that the view * projection matrix creates from the frustum, or is there one?

Jeremy
Quote:Does anyone know the technical name of the cuboid shape that the view * projection matrix creates from the frustum, or is there one?
I believe it is referred to as the 'canonical view volume'.

This topic is closed to new replies.

Advertisement