Sign in to follow this  
grill8

Question about cross API interpretation of the view_proj matrix.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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'.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this