Re: Matrix order

New Message Reply Date view Thread view Subject view Author view

Hansong Zhang (hansong++at++intrinsic.com)
Fri, 17 Sep 1999 14:50:28 -0700


> (Note however that OpenGL is strange in that it
> expects matrices in FORTRAN-style column-major order, so if you aren't careful
> you will end up giving it the transpose of the matrix you intended.
> This is extremely weird, so many OpenGL programmers (myself included)
> prefer to think and write OpenGL programs Performer-style (i.e. row vectors
> and left-to-right concatenation);
> the two reversals cancel each other out, everything works,
> and you get a more sane programming environment, in my humble opinion.)
>

Yeah. The column-major thing seems like a hack just to make a internally
"row-vector-mult-matrix" system appear to be a "matrix-mult-column-vector"
one in API. The latter is more prevalent in the academic world because of
the 2nd edition of Forley & van Dam (although the 1st edition, and IrisGL,
uses the former). I speculate that the column-major decision was made when
they derived OpenGL from IrisGL, wanted the column-vector look but didn't
want to change the implementation... so they changed the spec :-)

Hansong

----
Hansong Zhang, hansong++at++intrinsic.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Fri Sep 17 1999 - 14:50:38 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.