Re: model view matrix and rotation
Angus Dorbie (dorbie++at++multipass.asd.sgi.com)
Mon, 14 Jul 1997 21:07:27 -0700
On Jul 14, 2:06pm, Anita Kishore wrote:
> Subject: model view matrix and rotation
> Hi :
>
> I am confused with the following:
>
> I have a Pf application where the channel's view point pos = (x,y,z), and
> orientaion = (0,0,0). The graphics object that it is looking at is at the
> origin. This object's geode has pre and post draw callbacks. In the pre
> callback I do :
>
> - set mmode to mviewing
> - push matrix
> - getmatrix
> - print matrix
>
> As far as I understand, this matrix that I get is a composite transformation
> matrix for view point. Which means that its transpose will be of the form:
>
> a11 a12 a13 tx
> a21 a22 a23 ty
> a31 a32 a33 tz
> 0 0 0 1
>
>
> tx, ty, tz are the translation part and the upper LHS 3X3 sub-matrix contains
> the rotation and scale parts, right? But eventhough I do not have any
rotation
> or scale for the view point, the sub-matrix porion has some numbers in it and
> when I do pfGetOrthoMatCoord(mat, dst), dst->xyz is fine, just as I set the
> view point's position, but dst->hpr shows pitch = -90. Why is this not 0?
Because you read the GL matrix. Performer does a world coordinate conversion
from (GL) Y = up to (pf) Z = up which is the 90 degree rotation about x ie
pitch, although I wouldn't call it that since it's a different multiplicaton
order.
>
> Another related question is : what is the equivalent of getmatrix() in
OpenGL?
> The porting guide says GLGet(), but I can't find any man page or info in the
> OPenGL book.
>
GLfloat matarray[16];
glGetFloatv(GL_MODELVIEW_MATRIX, matarray);
Cheers,Angus.
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:55:36 PDT