From: Dick Rous (dick++at++sgi.com)
Date: 01/14/2005 02:24:28
Hi Don,
Thanks for the clarification.
So this is not a case of RTFM, but DNTTFM (Do Not Trust TFM)...;-)
Cheers,
Dick.
> -----Original Message-----
> From: Don Burns [mailto:don++at++andesengineering.com]
> Sent: Thursday, 13 January, 2005 18:42
> To: Dick Rous
> Cc: faculaganymede++at++yahoo.com; SGI Performer MailList
> Subject: RE: [info-performer] pfGetViewMat and pfGetProjMat
>
>
> Hm... well, not really. Yes, OpenGL is column major
> literarily (that means, it says so in the books)... but
> practically it is not. What I mean here is that a transpose
> is really not necessary. The matrix passed to
> glMultMatrix(), or glLoadMatrix() is, by all by all intents
> and purposes, a row-major matrix.
>
> Prove this to yourself. Write a little OpenGL program that
> translates an object along the X axis by 'X':
>
> // This will work:
> GLfloat mat[][4] = {
> { 1.0, 0.0, 0.0, 0.0},
> { 0.0, 1.0, 0.0, 0.0},
> { 0.0, 0.0, 1.0, 0.0},
> { X, 0.0, 0.0, 1.0}
> };
>
> glPushMatrix();
> glMultMatrixf( &mat[0][0] );
> glutSolidTeapot( 1.0 );
> glPopMatrix();
>
> a += 0.01;
>
> /// But this....
>
> GLfloat mat[][4] = {
> { 1.0, 0.0, 0.0, X},
> { 0.0, 1.0, 0.0, 0.0},
> { 0.0, 0.0, 1.0, 0.0},
> { 0.0, 0.0, 0.0, 1.0}
> };
>
> ... will have most amusing results.
>
> Cheers,
>
> -don
>
>
> On Thu, 13 Jan 2005, Dick Rous wrote:
>
> > There IS a difference.
> > Matrices in Performer are represented in row-major form,
> while OpenGL
> > uses a column-major ordering.
> > So, to go from Performer to OpenGL (or vice versa), you have to
> > transpose the pfMatrix.
> >
> > Eg, a translation matrix in Performer looks like:
> >
> > 1 0 0 0
> > 0 1 0 0
> > 0 0 1 0
> > x y z 1
> >
> > While in OpenGL this is represented as:
> >
> > 1 0 0 x
> > 0 1 0 y
> > 0 0 1 z
> > 0 0 0 1
> >
> > Hope this helps,
> >
> > Dick.
> >
> >
> > > -----Original Message-----
> > > From: owner-info-performer++at++performer.engr.sgi.com
> > > [mailto:owner-info-performer++at++performer.engr.sgi.com] On Behalf Of
> > > faculaganymede
> > > Sent: Wednesday, 12 January, 2005 17:33
> > > To: SGI Performer MailList
> > > Subject: [info-performer] pfGetViewMat and pfGetProjMat
> > >
> > > Hi All,
> > >
> > > Inside the channel draw call back function, I am making
> some calls
> > > to read the current projection and viewing matrices. I get
> > > different results from
> > > glGetFloatv() and the pfGet$_Mat() functions; the values of the
> > > returned matrices are different. Does anyone know why? I thought
> > > these two functions are equilvalent!?
> > >
> > > Code fragment:
> > > ...
> > > pfDraw();
> > >
> > > // GL
> > > GLfloat projMatD[16];
> > > GLfloat modelViewMatD[16];
> > > glGetFloatv(GL_PROJECTION_MATRIX, projMatD);
> > > glGetFloatv(GL_MODELVIEW_MATRIX, modelViewMatD);
> > >
> > > // PF
> > > pfMatrix ViewMat;
> > > pfMatrix ProjMat;
> > > pfGetViewMat(ViewMat);
> > > pfGetProjMat(ProjMat);
> > > ...
> > >
> > > =====
> > > Thanks,
> > > faculaganymede
> > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > All your favorites on one personal page - Try My Yahoo!
> > > http://my.yahoo.com
> > >
> > > --------------------------------------------------------------
> > > ---------
> > > List Archives, Info, FAQ:
> http://www.sgi.com/software/performer/
> > > Open Development Project:
> http://oss.sgi.com/projects/performer/
> > > Submissions: info-performer++at++sgi.com
> > > Admin. requests: info-performer-request++at++sgi.com
> > > --------------------------------------------------------------
> > > ---------
> > >
> >
> >
> --------------------------------------------------------------
> ---------
> > List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> > Open Development Project: http://oss.sgi.com/projects/performer/
> > Submissions: info-performer++at++sgi.com
> > Admin. requests: info-performer-request++at++sgi.com
> >
> ----------------------------------------------------------------------
> > -
> >
> >
>
This archive was generated by hypermail 2b29 : Fri Jan 14 2005 - 02:22:55 PST