Modelview matrix
Hi, I am implementing something in directx while using a openGL program as a reference and I came across a modelview matrix. I was just making sure this is the same as the view matrix in directx. The camera transformation matrix.
Thanks,
Chase
With respect to DX i think the direct equivalent would be a 'view * world' matrix. I'm not too familiar with DX (worked with 7, 8 and very limited in 9) so someone correct me if i'm wrong.
Quote:Original post by blizzard999
OpenGL modelview matrix should be the DX transposed...
I don't think so. DirectX maintains a different concept than OpenGL--it has seperate World and View matrices, whereas OpenGL has a combined ModelView matrix. In this respect nts is correct.
It is true, however, that DirectX matrices' are column major (where OpenGL's are row-major by default).
Quote:Original post by MikeMJH
I don't think so. DirectX maintains a different concept than OpenGL--it has seperate World and View matrices, whereas OpenGL has a combined ModelView matrix. In this respect nts is correct.
You are right but...world and view matrices are not different concepts!
Nts is right too
[GL modelview] = transposed([DX view] * [DX world])
Load the same matrix and you get the same results.
Quote:Original post by MikeMJHQuote:Original post by blizzard999
OpenGL modelview matrix should be the DX transposed...
I don't think so. DirectX maintains a different concept than OpenGL--it has seperate World and View matrices, whereas OpenGL has a combined ModelView matrix. In this respect nts is correct.
It is true, however, that DirectX matrices' are column major (where OpenGL's are row-major by default).
Um matrices in Direct3D are row-major while matrices in OpenGL are column-major.
From here:
Quote:9.005 Are OpenGL matrices column-major or row-major?
For programming purposes, OpenGL matrices are 16-value arrays with base vectors laid out contiguously in memory. The translation components occupy the 13th, 14th, and 15th elements of the 16-element matrix.
Column-major versus row-major is purely a notational convention. Note that post-multiplying with column-major matrices produces the same result as pre-multiplying with row-major matrices. The OpenGL Specification and the OpenGL Reference Manual both use column-major notation. You can use any notation, as long as it's clearly stated.
Sadly, the use of column-major format in the spec and blue book has resulted in endless confusion in the OpenGL programming community. Column-major notation suggests that matrices are not laid out in memory as a programmer would expect.
No sir thats not right. According to a very reliable source[MSDN] the translation matrix in OpenGL goes more like this :
For Direct3D you'd have to transpose the above matrix into row-major.
| 1 0 0 x || 0 1 0 y || 0 0 1 z || 0 0 0 1 |
For Direct3D you'd have to transpose the above matrix into row-major.
Instead of rating me down why don't you google it for yourself? Or visit MSDN.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc03_9a05.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc03_9a05.asp
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement