Don Hatch (hatch++at++hell.engr.sgi.com)
Fri, 17 Sep 1999 12:59:11 -0700
Regardless of row/column convention,
"post" always means apply the incremental operation
"after" the current cumulative transform
(i.e., intuitively, on the "world space" side of the cumulative transform
rather than the "local space" side).
So in Performer documentation and API
(which uses row vectors and left-to-right concatenation),
post-multiplying by a rotation R means M*R,
and to apply the result to a vertex (row vector) v you would write v*M*R.
But in OpenGL documentation
(which uses column vectors and right-to-left concatenation),
post-multiplying by R means R*M,
and to apply the result to a vertex (column vector) v you would write R*M*v.
(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.)
Don
-- Don Hatch hatch++at++sgi.com (650) 933-5150 Silicon Graphics, Inc.
This archive was generated by hypermail 2.0b2 on Fri Sep 17 1999 - 12:59:22 PDT