Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: How to get projection matrix???

  1. #11
    Junior Member
    Join Date
    Jan 2005
    Location
    UK
    Posts
    28
    I have used the function and it did not return NULL. so there is no problem with this

    regarding the suggestion. I should have made myself clearer. in order to load a matrix u use glLoadMatrix(...) with GL_PROJECTION or GL_MODLEVIEW as parameters. then glQueryMatrixxOES will query the matrix just loaded before its call (as in teh code snipet below).

    so, if you call glLoadMatrix(GL_PROJECTION); then glQueryMatrixxOES(); you will be able to query the proj matx, and that is possible done only in the Init() function. and if you call glLoadMatrix(GL_MODELVIEW); then glQueryMatrixxOES(); you will be able to query the modelvw matx, and this can be queried everytime as the modelview is the one on top alway.

    FC

  2. #12
    Senior Member
    Join Date
    May 2006
    Posts
    353
    Quote Originally Posted by Fadi Chehimi
    regarding the suggestion. I should have made myself clearer. in order to load a matrix u use glLoadMatrix(...) with GL_PROJECTION or GL_MODLEVIEW as parameters. then glQueryMatrixxOES will query the matrix just loaded before its call (as in teh code snipet below).

    so, if you call glLoadMatrix(GL_PROJECTION); then glQueryMatrixxOES(); you will be able to query the proj matx, and that is possible done only in the Init() function. and if you call glLoadMatrix(GL_MODELVIEW); then glQueryMatrixxOES(); you will be able to query the modelvw matx, and this can be queried everytime as the modelview is the one on top alway.
    I'm not sure I understand. Why do you think this only works in the Init function? glLoadMatrix doesn't take any parameter except the matrix. You can query all matrices at any time, all you have to do is set the right current matrix with glMatrixMode before calling glQueryMatrixxOES.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  3. #13
    Junior Member
    Join Date
    Jan 2005
    Location
    UK
    Posts
    28
    sorry i mixed up. i meant using glMatrixMode rather than glLoadMatrix.
    your explanation makes it clear to me. I thought that i can use glMatrixMode only in the Init func!!! But one question, wouldn't using glMatrixMode(GL_PROJECTION) cause the projection matrix to be loaded and multiplied by the current matrix, causing a modification in the scene?

    i gues the solution for this would be calling glMatrixMode(GL_MODELVIEW) after that. but i just wnat to know what would happen in i do not proceed the projection with a modelview.

    thanx
    FC

  4. #14
    Senior Member
    Join Date
    May 2006
    Posts
    353
    Hi Fadi,

    The GL doesn't know anything about your Init function. All that matters is making GL calls in the right order, from the same thread, but not in which of your functions you call them.

    glMatrixMode does not modify the contents of any matrix. It only sets the current matrix mode, i.e. all subsequent GL matrix manipulation calls will affect the selected matrix. Until you call glMatrixMode again with a different value.

    So if all your code assumes that the current matrix mode is GL_MODELVIEW, then every time you want to manipulate/query another matrix (projection or texture) you should make sure to set the matrix mode back to GL_MODELVIEW afterwards.

    If you don't do this, all further matrix manipulation calls would affect the projection matrix.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  5. #15
    Junior Member
    Join Date
    Jan 2005
    Location
    UK
    Posts
    28
    Ok now this makes sence
    thanx so much for ur help
    Fad

  6. #16
    Junior Member
    Join Date
    Jun 2007
    Posts
    7
    Quote Originally Posted by Xmas
    Quote Originally Posted by Fadi Chehimi
    the code below suggests querying the matrix needed just after loading it:
    I don't see where it suggests that. Once you have initialized the function pointer you can use glQueryMatrixxOES anywhere (provided it is declared at global scope).

    But again, please check that "OES_query_matrix" can be found in the extension string (and that the pointer returned by eglGetProcAddress is not NULL) before you use the extension.
    Hi all!
    I'm working on a Dell Axim x51v and I'm trying to use the GL_OES_query_matrix extension. I founded it in the extension string, and I load it the same way as you, but I get a NULL pointer calling the eglGetProcAddress function.

    Do you know why could be that?
    Thanks a lot in advance.
    Roberto

Page 2 of 2 FirstFirst 12

Similar Threads

  1. two-point perspective projection
    By dsasha in forum OpenGL ES general technical discussions
    Replies: 3
    Last Post: 06-03-2009, 03:43 AM
  2. How to get current MODELVIEW MATRIX and PROJECTION MATRI
    By czaoth in forum OpenGL ES general technical discussions
    Replies: 2
    Last Post: 05-21-2005, 02:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •