# Question about cross API interpretation of the view_proj matrix.

This topic is 3298 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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 on other sites
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

##### 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'.

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
14
5. 5

• 14
• 10
• 23
• 9
• 33
• ### Forum Statistics

• Total Topics
632631
• Total Posts
3007537
• ### Who's Online (See full list)

There are no registered users currently online

×