Results 1 to 3 of 3

Thread: keeping modelview matrix constant ????

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2002
    Posts
    27

    keeping modelview matrix constant ????

    hi,

    I displayed a 3D object in a MFC window.In my application, i am getting the x,y and z point of the object at the mouse clicked point in the initial stage.But when i rotate the object then the z value is changing.In the display function i push and pop the model view matrix and in mouse left button down i read the model view matrix.If any way to get the initial model view matrix when i click on the object ??

    where is the chance for problem ??

    Thanks,
    Jerry

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jan 2002
    Location
    Kingston, Jamaica, W.I.
    Posts
    282

    Re: keeping modelview matrix constant ????

    If you want the model view matrix after you rotate, you'll have to do a glGet before you do a glPopMatrix(). If not then the matrix should be where you want it and you can get it any time.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2000
    Location
    Greenbelt, MD, USA
    Posts
    29

    Re: keeping modelview matrix constant ????

    If you're going to be doing this alot, you should consider keeping your own copy of the modelview matrix and doing your own matrix transformations mirroring what you do in OpenGL. This will avoid expensive calls to glGet() because you can just read your own copy of the matrix.

Similar Threads

  1. Clarification (Projection Matrix & ModelView Matrix)?
    By CroCodile in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-01-2013, 11:43 AM
  2. Projection matrix for non-constant FOV
    By Aleksandar in forum OpenGL: General
    Replies: 6
    Last Post: 02-12-2011, 11:23 AM
  3. Lightning: ModelView matrix or just Model Matrix?
    By bliss in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-14-2011, 02:38 PM
  4. Texture Matrix vs. Modelview Matrix
    By PhilY in forum OpenGL: Advanced Coding
    Replies: 12
    Last Post: 03-03-2003, 03:13 AM
  5. Difference between Modelview matrix and projection matrix
    By aphlai in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 08-22-2001, 07:22 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
  •  
Proudly hosted by Digital Ocean