PDA

View Full Version : state.matrix.mvp?



A027298
01-05-2003, 10:08 PM
In the ARB_vertex_program extension I'm reading:

....
MVP = M0 * P,

where M0 is modelview matrix zero, and P is the projection matrix.
....

That's strange for me, because I thought a vertex is transformed like:
v' = P*M*v

but with state.matrix.mvp:
v' = M*P*v

Can somebody clarify this to me?

Thanks a lot!

abrodersen
01-06-2003, 12:47 AM
If I'm not mistaking, you should multiply v on the other side, thus:

v' = v*M*P

Anders

pbrown
01-06-2003, 09:30 PM
This certainly sounds like a bug in the spec. Implementations will almost certainly "do the right thing", since drivers have been working with MVP matrices since well before vertex programs arrived on the scene. I will confirm that this is wrong and fix the spec. (I was the editor of the spec, so you can blame me.)

ARB_fragment_program appears similarly busted -- I will pass this information along to the editor of this spec.

One other note: The example of matrix transposition in issue (50) was wrong in the spec. NV_vertex_program was similarly busted. This was fixed in version 36 of the spec. (Current version is 37.) Last time I checked, the registry hadn't been updated beyond version 34.

This was pretty embarassing when you consider the text of the issue:

(50) Discussing matrices is confusing because of row-major versus column-major issues. Can you give an example of how a matrix is bound?

A027298
01-07-2003, 05:14 AM
Now it's ok for me. In the beginning reading this in ARB_vertex_program (Version Last Modified Date: 7/19/2002 Revision: 34)
it was kind of confusing. Normally by convention a matrix is multiplied with a vector in the old traditional way: v' = M*v
and not like v' = v*M
So...the extension is working of course, the only 'bug' is this typo mvp.

vincoof
01-07-2003, 05:59 AM
Thanks for clearing that up. And assuming issue #50 was meant to clarify matrices, it was pretty annoying to get confused instead.

PH
01-07-2003, 06:15 AM
ATI's pdf with extensions has revision 23 of ARB_fragment_program. And NVIDIA has revision 37 of ARB_vertex_program ( and 22 of ARB_fp ). The registry is never up to date http://www.opengl.org/discussion_boards/ubb/smile.gif and personally I prefer the pdf versions. I prefer NVIDIAs pdf as it is sorted and contains a date of when it was last modified.

pbrown
01-10-2003, 06:33 PM
Thanks to A027298, there will now be a version 38 of ARB_vertex_program and a version 24 of ARB_fragment_program. Hopefully we can get them into the registry sometime soon.